explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MVXY : Optimization for: plan #BZ7v

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.183 3,161.188 ↑ 1.0 100 1

Limit (cost=261,437.76..261,449.43 rows=100 width=1,955) (actual time=3,153.585..3,161.188 rows=100 loops=1)

2. 14.235 3,161.005 ↑ 67.3 100 1

Gather Merge (cost=261,437.76..262,222.75 rows=6,728 width=1,955) (actual time=3,153.582..3,161.005 rows=100 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 1.807 3,146.770 ↑ 60.1 56 3 / 3

Sort (cost=260,437.74..260,446.15 rows=3,364 width=1,955) (actual time=3,146.715..3,146.770 rows=56 loops=3)

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

Nested Loop (cost=0.99..260,309.17 rows=3,364 width=1,955) (actual time=195.817..3,144.963 rows=646 loops=3)

5. 2.711 1,443.605 ↑ 5.2 646 3 / 3

Nested Loop (cost=0.56..240,455.73 rows=3,364 width=16) (actual time=124.717..1,443.605 rows=646 loops=3)

6. 1,158.592 1,158.592 ↑ 5.2 646 3 / 3

Parallel Seq Scan on client_metadata (cost=0.00..213,148.65 rows=3,340 width=37) (actual time=124.579..1,158.592 rows=646 loops=3)

  • Filter: (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[]))
  • Rows Removed by Filter: 1413705
7. 282.302 282.302 ↑ 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.436..0.437 rows=1 loops=1,938)

  • Index Cond: ((base_entity_id)::text = (client_metadata.base_entity_id)::text)
  • Filter: (server_version >= 0)
8. 1,698.980 1,698.980 ↑ 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=2.630..2.630 rows=1 loops=1,938)

  • Index Cond: (id = event_metadata.event_id)
Planning time : 2.704 ms
Execution time : 3,161.496 ms