explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dEhs

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.433 88.693 ↓ 43.7 262 1

GroupAggregate (cost=121,503.74..121,503.87 rows=6 width=48) (actual time=88.225..88.693 rows=262 loops=1)

  • Group Key: executions.user_uuid, executions.store_uuid
2. 0.241 88.260 ↓ 43.7 262 1

Sort (cost=121,503.74..121,503.75 rows=6 width=36) (actual time=88.201..88.260 rows=262 loops=1)

  • Sort Key: executions.user_uuid, executions.store_uuid
  • Sort Method: quicksort Memory: 45kB
3. 0.116 88.019 ↓ 43.7 262 1

Nested Loop (cost=118,774.87..121,503.66 rows=6 width=36) (actual time=81.141..88.019 rows=262 loops=1)

4. 0.017 0.017 ↑ 1.0 1 1

Index Scan using index_activities_on_uuid on activities (cost=0.29..8.31 rows=1 width=32) (actual time=0.014..0.017 rows=1 loops=1)

  • Index Cond: (uuid = '9c71adfd-5b88-4186-a4e5-96d16ecddaf0'::uuid)
  • Filter: (active AND ((state)::text = ANY ('{published,unpublished}'::text[])) AND (company_uuid = '38836b91-5616-4698-ac9d-4a147c255002'::uuid) AND (enum_activity_type = 0))
5. 5.477 87.886 ↓ 43.7 262 1

Hash Semi Join (cost=118,774.58..121,495.28 rows=6 width=68) (actual time=81.125..87.886 rows=262 loops=1)

  • Hash Cond: (stores.uuid = activity_assignations.store_uuid)
6. 0.084 1.634 ↓ 4.0 262 1

Nested Loop (cost=0.42..1,556.69 rows=66 width=84) (actual time=0.040..1.634 rows=262 loops=1)

7. 0.114 0.374 ↓ 2.0 294 1

Append (cost=0.00..315.19 rows=148 width=68) (actual time=0.029..0.374 rows=294 loops=1)

8. 0.013 0.013 ↓ 0.0 0 1

Seq Scan on executions (cost=0.00..0.00 rows=1 width=68) (actual time=0.012..0.013 rows=0 loops=1)

  • Filter: ((started_at >= '2020-06-22 05:00:00'::timestamp without time zone) AND (started_at <= '2020-06-23 04:59:59'::timestamp without time zone) AND (company_uuid = '38836b91-5616-4698-ac9d-4a147c255002'::uuid) AND (activity_uuid = '9c71adfd-5b88-4186-a4e5-96d16ecddaf0'::uuid) AND (activity_type_id = 1))
9. 0.247 0.247 ↓ 2.0 294 1

Index Scan using executions_38836b91_202006_company_date_activity_store_user on executions_38836b91_202006 (cost=0.28..315.19 rows=147 width=68) (actual time=0.016..0.247 rows=294 loops=1)

  • Index Cond: ((company_uuid = '38836b91-5616-4698-ac9d-4a147c255002'::uuid) AND (started_at >= '2020-06-22 05:00:00'::timestamp without time zone) AND (started_at <= '2020-06-23 04:59:59'::timestamp without time zone) AND (activity_type_id = 1) AND (activity_uuid = '9c71adfd-5b88-4186-a4e5-96d16ecddaf0'::uuid))
10. 1.176 1.176 ↑ 1.0 1 294

Index Scan using index_stores_on_uuid on stores (cost=0.42..8.39 rows=1 width=16) (actual time=0.004..0.004 rows=1 loops=294)

  • Index Cond: (uuid = executions.store_uuid)
  • Filter: active
  • Rows Removed by Filter: 0
11. 29.034 80.775 ↑ 1.4 78,837 1

Hash (cost=116,572.38..116,572.38 rows=113,822 width=32) (actual time=80.775..80.775 rows=78,837 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 1,750kB
12. 51.741 51.741 ↑ 1.4 78,837 1

Index Only Scan using index_activity_assignations_on_company_and_user_and_store on activity_assignations (cost=0.56..116,572.38 rows=113,822 width=32) (actual time=0.020..51.741 rows=78,837 loops=1)

  • Index Cond: (company_uuid = '38836b91-5616-4698-ac9d-4a147c255002'::uuid)
  • Heap Fetches: 78,434
Planning time : 397.738 ms
Execution time : 88.904 ms