explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KtLL

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,940.499 ↑ 3.6 84 1

Unique (cost=271,340.67..271,348.25 rows=305 width=4) (actual time=1,940.457..1,940.499 rows=84 loops=1)

2.          

Initplan (forUnique)

3. 0.027 382.803 ↑ 1.0 1 1

Aggregate (cost=176,401.81..176,401.83 rows=1 width=32) (actual time=382.803..382.803 rows=1 loops=1)

4. 5.210 382.776 ↑ 4.0 1 1

Gather (cost=69,322.19..176,401.74 rows=4 width=8) (actual time=382.763..382.776 rows=1 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
5. 5.248 377.566 ↓ 0.0 0 5

Hash Join (cost=68,322.19..175,401.34 rows=1 width=8) (actual time=348.234..377.566 rows=0 loops=5)

  • Hash Cond: (ledp.parent_id = ed1.id)
6. 111.782 372.155 ↑ 1.2 17,264 5

Nested Loop (cost=68,178.42..174,999.83 rows=20,416 width=12) (actual time=227.844..372.155 rows=17,264 loops=5)

7. 31.586 260.369 ↑ 1.0 20,097 5

Parallel Bitmap Heap Scan on entity_data ed2 (cost=68,177.99..135,505.87 rows=20,628 width=12) (actual time=227.785..260.369 rows=20,097 loops=5)

  • Recheck Cond: ((service_id IS NULL) AND (region_id IS NULL))
  • Filter: (NOT deleted)
  • Rows Removed by Filter: 6529
  • Heap Blocks: exact=4876
8. 1.127 228.783 ↓ 0.0 0 1

BitmapAnd (cost=68,177.99..68,177.99 rows=83,291 width=0) (actual time=228.783..228.783 rows=0 loops=1)

9. 14.218 14.218 ↓ 1.1 289,164 1

Bitmap Index Scan on idx_entity_data_4 (cost=0.00..3,001.43 rows=264,613 width=0) (actual time=14.218..14.218 rows=289,164 loops=1)

  • Index Cond: (service_id IS NULL)
10. 213.438 213.438 ↓ 1.0 5,825,072 1

Bitmap Index Scan on idx_entity_data_3 (cost=0.00..65,135.04 rows=5,744,241 width=0) (actual time=213.438..213.438 rows=5,825,072 loops=1)

  • Index Cond: (region_id IS NULL)
11. 0.004 0.004 ↑ 1.0 1 100,487

Index Scan using idx_link_entity_data_parent_2 on link_entity_data_parent ledp (cost=0.44..1.90 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=100,487)

  • Index Cond: (data_id = ed2.id)
  • Filter: ((deleted IS NULL) OR (NOT deleted))
  • Rows Removed by Filter: 0
12. 0.015 0.163 ↑ 18.6 54 5

Hash (cost=131.21..131.21 rows=1,004 width=4) (actual time=0.163..0.163 rows=54 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
13. 0.148 0.148 ↑ 18.6 54 5

Index Scan using idx_entity_data_5 on entity_data ed1 (cost=0.44..131.21 rows=1,004 width=4) (actual time=0.055..0.148 rows=54 loops=5)

  • Index Cond: (entity_id = 1009)
  • Filter: ((NOT deleted) AND (entity_type_id = 3))
  • Rows Removed by Filter: 84
14. 0.050 1,940.468 ↑ 18.0 84 1

Sort (cost=94,938.84..94,942.63 rows=1,516 width=4) (actual time=1,940.455..1,940.468 rows=84 loops=1)

  • Sort Key: lec.country_id
  • Sort Method: quicksort Memory: 28kB
15. 1,940.418 1,940.418 ↑ 18.0 84 1

Index Scan using idx_link_entity_country_global_notdelete on link_entity_country lec (cost=0.43..94,858.75 rows=1,516 width=4) (actual time=444.497..1,940.418 rows=84 loops=1)

  • Filter: ((((((((('{"'::text || (entity_id)::text) || '"'::text) || ': '::text) || '"'::text) || (entity_type_id)::text) || '"'::text) || '}'::text))::jsonb <@ $2)
  • Rows Removed by Filter: 1519681