explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1tT9 : Optimization for: plan #rhRC

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.157 995.666 ↑ 1.0 100 1

Limit (cost=74,310.58..74,322.25 rows=100 width=1,955) (actual time=991.593..995.666 rows=100 loops=1)

2. 264.078 995.509 ↑ 67.3 100 1

Gather Merge (cost=74,310.58..75,096.03 rows=6,732 width=1,955) (actual time=991.589..995.509 rows=100 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 1.846 731.431 ↑ 55.2 61 3 / 3

Sort (cost=73,310.56..73,318.97 rows=3,366 width=1,955) (actual time=731.378..731.431 rows=61 loops=3)

  • Sort Key: event_metadata.server_version
  • Sort Method: top-N heapsort Memory: 299kB
  • Worker 0: Sort Method: top-N heapsort Memory: 226kB
  • Worker 1: Sort Method: top-N heapsort Memory: 226kB
4. 1.926 729.585 ↑ 5.2 646 3 / 3

Nested Loop (cost=239.92..73,181.91 rows=3,366 width=1,955) (actual time=28.464..729.585 rows=646 loops=3)

5. 2.337 110.083 ↑ 5.2 646 3 / 3

Nested Loop (cost=239.49..53,311.11 rows=3,366 width=16) (actual time=18.871..110.083 rows=646 loops=3)

6. 67.749 86.428 ↑ 5.1 646 3 / 3

Parallel Bitmap Heap Scan on client_metadata (cost=238.93..26,119.34 rows=3,325 width=37) (actual time=18.753..86.428 rows=646 loops=3)

  • Recheck Cond: (village_id = ANY ('{1584559556640,99060,99061,99062,99063,99064,99065,99066,99067,99068,99069,99070,99071,99072,99073,99074,99075,99076,99077,129494,100}'::bigint[]))
  • Heap Blocks: exact=106
7. 18.679 18.679 ↑ 4.1 1,938 1 / 3

Bitmap Index Scan on client_metadata_village_id_idx (cost=0.00..236.93 rows=7,980 width=0) (actual time=56.035..56.037 rows=1,938 loops=1)

  • Index Cond: (village_id = ANY ('{1584559556640,99060,99061,99062,99063,99064,99065,99066,99067,99068,99069,99070,99071,99072,99073,99074,99075,99076,99077,129494,100}'::bigint[]))
8. 21.318 21.318 ↑ 1.0 1 1,938 / 3

Index Scan using event_metadata_base_entity_id_index on event_metadata (cost=0.56..8.17 rows=1 width=53) (actual time=0.032..0.033 rows=1 loops=1,938)

  • Index Cond: ((base_entity_id)::text = (client_metadata.base_entity_id)::text)
  • Filter: (server_version >= 0)
9. 617.576 617.576 ↑ 1.0 1 1,938 / 3

Index Scan using event_pkey on event (cost=0.43..5.90 rows=1 width=1,947) (actual time=0.956..0.956 rows=1 loops=1,938)

  • Index Cond: (id = event_metadata.event_id)
Planning time : 0.955 ms
Execution time : 995.910 ms