explain.depesz.com

PostgreSQL's explain analyze made readable

Result: shx6

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.002 17,328.617 ↑ 1.0 1 1

Limit (cost=2.39..2.55 rows=1 width=15) (actual time=17,328.616..17,328.617 rows=1 loops=1)

2. 37.884 17,328.615 ↑ 981,475.0 1 1

Nested Loop (cost=2.39..157,231.38 rows=981,475 width=15) (actual time=17,328.614..17,328.615 rows=1 loops=1)

3. 26.309 84.451 ↑ 1.5 11,410 1

Nested Loop Anti Join (cost=0.28..7,077.59 rows=17,452 width=15) (actual time=2.405..84.451 rows=11,410 loops=1)

4. 17.396 17.396 ↑ 1.4 13,582 1

Seq Scan on persons_external (cost=0.00..1,441.60 rows=18,828 width=15) (actual time=2.394..17.396 rows=13,582 loops=1)

  • Filter: ((source)::text = 'imdb'::text)
  • Rows Removed by Filter: 55,166
5. 40.746 40.746 ↓ 0.0 0 13,582

Index Only Scan using _tmp_wikidata_persons_check_k on _tmp_wikidata_persons_check (cost=0.28..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=13,582)

  • Index Cond: (id = persons_external.person_id)
  • Heap Fetches: 2,173
6. 102.690 17,206.280 ↓ 0.0 0 11,410

Bitmap Heap Scan on movies (cost=2.11..8.04 rows=56 width=28) (actual time=1.508..1.508 rows=0 loops=11,410)

  • Recheck Cond: (actors @> ARRAY[persons_external.person_id])
  • Filter: ((("IMDB" IS NULL) OR (("IMDB")::text = ''::text)) AND (countrys @> '{1}'::integer[]))
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=37,990
7. 17,103.590 17,103.590 ↑ 69.0 4 11,410

Bitmap Index Scan on movies_k_actors (cost=0.00..2.10 rows=276 width=0) (actual time=1.499..1.499 rows=4 loops=11,410)

  • Index Cond: (actors @> ARRAY[persons_external.person_id])
Planning time : 0.289 ms
Execution time : 17,328.670 ms