========================================================
 Detailed Analysis for Query: 17b 
 Source File: 17b.sql
 Date: Sun Dec 21 12:30:23 CST 2025
========================================================


################################################################
# CONFIGURATION: dp
################################################################

SET
SET
                                                                                     QUERY PLAN                                                                                      
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=4480.72..4480.73 rows=1 width=64) (actual time=25608.036..25608.038 rows=1.00 loops=1)
   Output: min(n.name), min(n.name)
   Buffers: shared hit=5205136 read=301059
   ->  Nested Loop  (cost=8.97..4480.62 rows=40 width=15) (actual time=63.926..25604.356 rows=52306.00 loops=1)
         Output: n.name
         Inner Unique: true
         Buffers: shared hit=5205136 read=301059
         ->  Nested Loop  (cost=8.55..4463.07 rows=40 width=19) (actual time=63.809..25485.159 rows=52306.00 loops=1)
               Output: mc.company_id, n.name
               Buffers: shared hit=5049051 read=300225
               ->  Nested Loop  (cost=8.12..4455.09 rows=14 width=27) (actual time=63.686..25055.152 rows=6642.00 loops=1)
                     Output: ci.movie_id, mk.movie_id, n.name, t.id
                     Inner Unique: true
                     Buffers: shared hit=5024704 read=293122
                     ->  Nested Loop  (cost=7.69..4448.81 rows=14 width=23) (actual time=63.552..24814.632 rows=6642.00 loops=1)
                           Output: ci.movie_id, mk.movie_id, n.name
                           Inner Unique: true
                           Buffers: shared hit=5006904 read=290902
                           ->  Nested Loop  (cost=7.26..3825.74 rows=1361 width=12) (actual time=3.325..19373.236 rows=1038393.00 loops=1)
                                 Output: ci.person_id, ci.movie_id, mk.movie_id
                                 Buffers: shared hit=922117 read=222117
                                 ->  Nested Loop  (cost=6.82..3764.68 rows=34 width=4) (actual time=3.156..61.889 rows=41840.00 loops=1)
                                       Output: mk.movie_id
                                       Buffers: shared hit=2 read=12526
                                       ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.421..5.924 rows=1.00 loops=1)
                                             Output: k.id, k.keyword, k.phonetic_code
                                             Filter: (k.keyword = 'character-name-in-title'::text)
                                             Rows Removed by Filter: 134169
                                             Buffers: shared read=949
                                       ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.82..1135.48 rows=308 width=8) (actual time=2.734..52.824 rows=41840.00 loops=1)
                                             Output: mk.id, mk.movie_id, mk.keyword_id
                                             Recheck Cond: (k.id = mk.keyword_id)
                                             Heap Blocks: exact=11541
                                             Buffers: shared hit=2 read=11577
                                             ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.74 rows=308 width=0) (actual time=1.715..1.715 rows=41840.00 loops=1)
                                                   Index Cond: (mk.keyword_id = k.id)
                                                   Index Searches: 1
                                                   Buffers: shared hit=2 read=36
                                 ->  Index Scan using movie_id_cast_info on public.cast_info ci  (cost=0.44..1.40 rows=40 width=8) (actual time=0.034..0.460 rows=24.82 loops=41840)
                                       Output: ci.id, ci.person_id, ci.movie_id, ci.person_role_id, ci.note, ci.nr_order, ci.role_id
                                       Index Cond: (ci.movie_id = mk.movie_id)
                                       Index Searches: 41840
                                       Buffers: shared hit=922115 read=209591
                           ->  Index Scan using name_pkey on public.name n  (cost=0.43..0.46 rows=1 width=19) (actual time=0.005..0.005 rows=0.01 loops=1038393)
                                 Output: n.id, n.name, n.imdb_index, n.imdb_id, n.gender, n.name_pcode_cf, n.name_pcode_nf, n.surname_pcode, n.md5sum
                                 Index Cond: (n.id = ci.person_id)
                                 Filter: (n.name ~~ 'Z%'::text)
                                 Rows Removed by Filter: 1
                                 Index Searches: 1038393
                                 Buffers: shared hit=4084787 read=68785
                     ->  Index Only Scan using title_pkey on public.title t  (cost=0.43..0.45 rows=1 width=4) (actual time=0.036..0.036 rows=1.00 loops=6642)
                           Output: t.id
                           Index Cond: (t.id = ci.movie_id)
                           Heap Fetches: 0
                           Index Searches: 6642
                           Buffers: shared hit=17800 read=2220
               ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.52 rows=5 width=8) (actual time=0.044..0.064 rows=7.88 loops=6642)
                     Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                     Index Cond: (mc.movie_id = ci.movie_id)
                     Index Searches: 6642
                     Buffers: shared hit=24347 read=7103
         ->  Index Only Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.44 rows=1 width=4) (actual time=0.002..0.002 rows=1.00 loops=52306)
               Output: cn.id
               Index Cond: (cn.id = mc.company_id)
               Heap Fetches: 0
               Index Searches: 52306
               Buffers: shared hit=156085 read=834
 Planning:
   Buffers: shared hit=551 read=49 dirtied=1
 Planning Time: 6.406 ms
 Execution Time: 25608.185 ms
(71 rows)


################################################################
# CONFIGURATION: goo_cost
################################################################

SET
SET
SET
                                                                                       QUERY PLAN                                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=4111.69..4111.70 rows=1 width=64) (actual time=13234.872..13234.875 rows=1.00 loops=1)
   Output: min(n.name), min(n.name)
   Buffers: shared hit=39954893 read=14180
   ->  Nested Loop  (cost=8.97..4111.68 rows=5 width=15) (actual time=7.097..13231.371 rows=52306.00 loops=1)
         Output: n.name
         Inner Unique: true
         Buffers: shared hit=39954893 read=14180
         ->  Nested Loop  (cost=8.54..3882.32 rows=501 width=4) (actual time=3.270..3706.469 rows=7796926.00 loops=1)
               Output: ci.person_id
               Join Filter: (ci.movie_id = t.id)
               Buffers: shared hit=8767189 read=14180
               ->  Nested Loop  (cost=8.10..3815.97 rows=35 width=12) (actual time=2.977..1239.062 rows=148552.00 loops=1)
                     Output: mc.movie_id, t.id, mk.movie_id
                     Inner Unique: true
                     Buffers: shared hit=758506 read=14180
                     ->  Nested Loop  (cost=7.68..3800.61 rows=35 width=16) (actual time=2.972..1017.428 rows=148552.00 loops=1)
                           Output: mc.movie_id, mc.company_id, t.id, mk.movie_id
                           Join Filter: (mc.movie_id = t.id)
                           Buffers: shared hit=312890 read=14139
                           ->  Nested Loop  (cost=7.25..3780.17 rows=34 width=8) (actual time=2.520..443.742 rows=41840.00 loops=1)
                                 Output: t.id, mk.movie_id
                                 Inner Unique: true
                                 Buffers: shared hit=135269 read=3499
                                 ->  Nested Loop  (cost=6.82..3764.68 rows=34 width=4) (actual time=2.508..39.427 rows=41840.00 loops=1)
                                       Output: mk.movie_id
                                       Buffers: shared hit=12528
                                       ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.293..5.133 rows=1.00 loops=1)
                                             Output: k.id, k.keyword, k.phonetic_code
                                             Filter: (k.keyword = 'character-name-in-title'::text)
                                             Rows Removed by Filter: 134169
                                             Buffers: shared hit=949
                                       ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.82..1135.48 rows=308 width=8) (actual time=2.215..31.833 rows=41840.00 loops=1)
                                             Output: mk.id, mk.movie_id, mk.keyword_id
                                             Recheck Cond: (k.id = mk.keyword_id)
                                             Heap Blocks: exact=11541
                                             Buffers: shared hit=11579
                                             ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.74 rows=308 width=0) (actual time=1.320..1.320 rows=41840.00 loops=1)
                                                   Index Cond: (mk.keyword_id = k.id)
                                                   Index Searches: 1
                                                   Buffers: shared hit=38
                                 ->  Index Only Scan using title_pkey on public.title t  (cost=0.43..0.46 rows=1 width=4) (actual time=0.010..0.010 rows=1.00 loops=41840)
                                       Output: t.id
                                       Index Cond: (t.id = mk.movie_id)
                                       Heap Fetches: 0
                                       Index Searches: 41840
                                       Buffers: shared hit=122741 read=3499
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.54 rows=5 width=8) (actual time=0.009..0.013 rows=3.55 loops=41840)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = mk.movie_id)
                                 Index Searches: 41840
                                 Buffers: shared hit=177621 read=10640
                     ->  Index Only Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.44 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=148552)
                           Output: cn.id
                           Index Cond: (cn.id = mc.company_id)
                           Heap Fetches: 0
                           Index Searches: 148552
                           Buffers: shared hit=445616 read=41
               ->  Index Scan using movie_id_cast_info on public.cast_info ci  (cost=0.44..1.40 rows=40 width=8) (actual time=0.001..0.013 rows=52.49 loops=148552)
                     Output: ci.id, ci.person_id, ci.movie_id, ci.person_role_id, ci.note, ci.nr_order, ci.role_id
                     Index Cond: (ci.movie_id = mk.movie_id)
                     Index Searches: 148552
                     Buffers: shared hit=8008683
         ->  Index Scan using name_pkey on public.name n  (cost=0.43..0.46 rows=1 width=19) (actual time=0.001..0.001 rows=0.01 loops=7796926)
               Output: n.id, n.name, n.imdb_index, n.imdb_id, n.gender, n.name_pcode_cf, n.name_pcode_nf, n.surname_pcode, n.md5sum
               Index Cond: (n.id = ci.person_id)
               Filter: (n.name ~~ 'Z%'::text)
               Rows Removed by Filter: 1
               Index Searches: 7796926
               Buffers: shared hit=31187704
 Planning:
   Buffers: shared hit=600
 Planning Time: 1.604 ms
 Execution Time: 13234.980 ms
(73 rows)


################################################################
# CONFIGURATION: goo_result_size
################################################################

SET
SET
SET
                                                                                       QUERY PLAN                                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=4111.69..4111.70 rows=1 width=64) (actual time=12324.374..12324.376 rows=1.00 loops=1)
   Output: min(n.name), min(n.name)
   Buffers: shared hit=39969073
   ->  Nested Loop  (cost=8.97..4111.68 rows=5 width=15) (actual time=4.736..12320.970 rows=52306.00 loops=1)
         Output: n.name
         Inner Unique: true
         Buffers: shared hit=39969073
         ->  Nested Loop  (cost=8.54..3882.32 rows=501 width=4) (actual time=2.462..2828.676 rows=7796926.00 loops=1)
               Output: ci.person_id
               Join Filter: (ci.movie_id = t.id)
               Buffers: shared hit=8781369
               ->  Nested Loop  (cost=8.10..3815.97 rows=35 width=12) (actual time=2.419..394.462 rows=148552.00 loops=1)
                     Output: mc.movie_id, t.id, mk.movie_id
                     Inner Unique: true
                     Buffers: shared hit=772686
                     ->  Nested Loop  (cost=7.68..3800.61 rows=35 width=16) (actual time=2.412..184.251 rows=148552.00 loops=1)
                           Output: mc.movie_id, mc.company_id, t.id, mk.movie_id
                           Join Filter: (mc.movie_id = t.id)
                           Buffers: shared hit=327029
                           ->  Nested Loop  (cost=7.25..3780.17 rows=34 width=8) (actual time=2.395..84.133 rows=41840.00 loops=1)
                                 Output: t.id, mk.movie_id
                                 Inner Unique: true
                                 Buffers: shared hit=138768
                                 ->  Nested Loop  (cost=6.82..3764.68 rows=34 width=4) (actual time=2.387..29.184 rows=41840.00 loops=1)
                                       Output: mk.movie_id
                                       Buffers: shared hit=12528
                                       ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.229..5.114 rows=1.00 loops=1)
                                             Output: k.id, k.keyword, k.phonetic_code
                                             Filter: (k.keyword = 'character-name-in-title'::text)
                                             Rows Removed by Filter: 134169
                                             Buffers: shared hit=949
                                       ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.82..1135.48 rows=308 width=8) (actual time=2.158..21.645 rows=41840.00 loops=1)
                                             Output: mk.id, mk.movie_id, mk.keyword_id
                                             Recheck Cond: (k.id = mk.keyword_id)
                                             Heap Blocks: exact=11541
                                             Buffers: shared hit=11579
                                             ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.74 rows=308 width=0) (actual time=1.252..1.252 rows=41840.00 loops=1)
                                                   Index Cond: (mk.keyword_id = k.id)
                                                   Index Searches: 1
                                                   Buffers: shared hit=38
                                 ->  Index Only Scan using title_pkey on public.title t  (cost=0.43..0.46 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=41840)
                                       Output: t.id
                                       Index Cond: (t.id = mk.movie_id)
                                       Heap Fetches: 0
                                       Index Searches: 41840
                                       Buffers: shared hit=126240
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.54 rows=5 width=8) (actual time=0.001..0.002 rows=3.55 loops=41840)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = mk.movie_id)
                                 Index Searches: 41840
                                 Buffers: shared hit=188261
                     ->  Index Only Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.44 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=148552)
                           Output: cn.id
                           Index Cond: (cn.id = mc.company_id)
                           Heap Fetches: 0
                           Index Searches: 148552
                           Buffers: shared hit=445657
               ->  Index Scan using movie_id_cast_info on public.cast_info ci  (cost=0.44..1.40 rows=40 width=8) (actual time=0.001..0.013 rows=52.49 loops=148552)
                     Output: ci.id, ci.person_id, ci.movie_id, ci.person_role_id, ci.note, ci.nr_order, ci.role_id
                     Index Cond: (ci.movie_id = mk.movie_id)
                     Index Searches: 148552
                     Buffers: shared hit=8008683
         ->  Index Scan using name_pkey on public.name n  (cost=0.43..0.46 rows=1 width=19) (actual time=0.001..0.001 rows=0.01 loops=7796926)
               Output: n.id, n.name, n.imdb_index, n.imdb_id, n.gender, n.name_pcode_cf, n.name_pcode_nf, n.surname_pcode, n.md5sum
               Index Cond: (n.id = ci.person_id)
               Filter: (n.name ~~ 'Z%'::text)
               Rows Removed by Filter: 1
               Index Searches: 7796926
               Buffers: shared hit=31187704
 Planning:
   Buffers: shared hit=605
 Planning Time: 1.546 ms
 Execution Time: 12324.444 ms
(73 rows)


################################################################
# CONFIGURATION: goo_combined
################################################################

SET
SET
SET
                                                                                       QUERY PLAN                                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=4111.69..4111.70 rows=1 width=64) (actual time=12430.479..12430.483 rows=1.00 loops=1)
   Output: min(n.name), min(n.name)
   Buffers: shared hit=39969073
   ->  Nested Loop  (cost=8.97..4111.68 rows=5 width=15) (actual time=4.803..12427.352 rows=52306.00 loops=1)
         Output: n.name
         Inner Unique: true
         Buffers: shared hit=39969073
         ->  Nested Loop  (cost=8.54..3882.32 rows=501 width=4) (actual time=2.456..2863.203 rows=7796926.00 loops=1)
               Output: ci.person_id
               Join Filter: (ci.movie_id = t.id)
               Buffers: shared hit=8781369
               ->  Nested Loop  (cost=8.10..3815.97 rows=35 width=12) (actual time=2.410..404.656 rows=148552.00 loops=1)
                     Output: mc.movie_id, t.id, mk.movie_id
                     Inner Unique: true
                     Buffers: shared hit=772686
                     ->  Nested Loop  (cost=7.68..3800.61 rows=35 width=16) (actual time=2.403..189.284 rows=148552.00 loops=1)
                           Output: mc.movie_id, mc.company_id, t.id, mk.movie_id
                           Join Filter: (mc.movie_id = t.id)
                           Buffers: shared hit=327029
                           ->  Nested Loop  (cost=7.25..3780.17 rows=34 width=8) (actual time=2.386..86.201 rows=41840.00 loops=1)
                                 Output: t.id, mk.movie_id
                                 Inner Unique: true
                                 Buffers: shared hit=138768
                                 ->  Nested Loop  (cost=6.82..3764.68 rows=34 width=4) (actual time=2.374..29.959 rows=41840.00 loops=1)
                                       Output: mk.movie_id
                                       Buffers: shared hit=12528
                                       ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.229..5.706 rows=1.00 loops=1)
                                             Output: k.id, k.keyword, k.phonetic_code
                                             Filter: (k.keyword = 'character-name-in-title'::text)
                                             Rows Removed by Filter: 134169
                                             Buffers: shared hit=949
                                       ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.82..1135.48 rows=308 width=8) (actual time=2.145..21.812 rows=41840.00 loops=1)
                                             Output: mk.id, mk.movie_id, mk.keyword_id
                                             Recheck Cond: (k.id = mk.keyword_id)
                                             Heap Blocks: exact=11541
                                             Buffers: shared hit=11579
                                             ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.74 rows=308 width=0) (actual time=1.236..1.236 rows=41840.00 loops=1)
                                                   Index Cond: (mk.keyword_id = k.id)
                                                   Index Searches: 1
                                                   Buffers: shared hit=38
                                 ->  Index Only Scan using title_pkey on public.title t  (cost=0.43..0.46 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=41840)
                                       Output: t.id
                                       Index Cond: (t.id = mk.movie_id)
                                       Heap Fetches: 0
                                       Index Searches: 41840
                                       Buffers: shared hit=126240
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.54 rows=5 width=8) (actual time=0.001..0.002 rows=3.55 loops=41840)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = mk.movie_id)
                                 Index Searches: 41840
                                 Buffers: shared hit=188261
                     ->  Index Only Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.44 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=148552)
                           Output: cn.id
                           Index Cond: (cn.id = mc.company_id)
                           Heap Fetches: 0
                           Index Searches: 148552
                           Buffers: shared hit=445657
               ->  Index Scan using movie_id_cast_info on public.cast_info ci  (cost=0.44..1.40 rows=40 width=8) (actual time=0.001..0.013 rows=52.49 loops=148552)
                     Output: ci.id, ci.person_id, ci.movie_id, ci.person_role_id, ci.note, ci.nr_order, ci.role_id
                     Index Cond: (ci.movie_id = mk.movie_id)
                     Index Searches: 148552
                     Buffers: shared hit=8008683
         ->  Index Scan using name_pkey on public.name n  (cost=0.43..0.46 rows=1 width=19) (actual time=0.001..0.001 rows=0.01 loops=7796926)
               Output: n.id, n.name, n.imdb_index, n.imdb_id, n.gender, n.name_pcode_cf, n.name_pcode_nf, n.surname_pcode, n.md5sum
               Index Cond: (n.id = ci.person_id)
               Filter: (n.name ~~ 'Z%'::text)
               Rows Removed by Filter: 1
               Index Searches: 7796926
               Buffers: shared hit=31187704
 Planning:
   Buffers: shared hit=605
 Planning Time: 2.103 ms
 Execution Time: 12430.588 ms
(73 rows)


################################################################
# CONFIGURATION: geqo
################################################################

SET
SET
                                                                                     QUERY PLAN                                                                                     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=4077.04..4077.05 rows=1 width=64) (actual time=3652.605..3652.608 rows=1.00 loops=1)
   Output: min(n.name), min(n.name)
   Buffers: shared hit=5612415
   ->  Nested Loop  (cost=8.97..4077.01 rows=15 width=15) (actual time=4.143..3650.783 rows=52306.00 loops=1)
         Output: n.name
         Inner Unique: true
         Buffers: shared hit=5612415
         ->  Nested Loop  (cost=8.55..4070.42 rows=15 width=19) (actual time=4.137..3589.620 rows=52306.00 loops=1)
               Output: n.name, mc.company_id
               Buffers: shared hit=5455496
               ->  Nested Loop  (cost=8.12..4067.57 rows=5 width=27) (actual time=4.130..3567.844 rows=6642.00 loops=1)
                     Output: n.name, t.id, mk.movie_id, ci.movie_id
                     Inner Unique: true
                     Buffers: shared hit=5424046
                     ->  Nested Loop  (cost=7.69..3844.62 rows=487 width=16) (actual time=2.453..993.410 rows=1038393.00 loops=1)
                           Output: t.id, mk.movie_id, ci.person_id, ci.movie_id
                           Join Filter: (ci.movie_id = t.id)
                           Buffers: shared hit=1270474
                           ->  Nested Loop  (cost=7.25..3780.17 rows=34 width=8) (actual time=2.444..82.751 rows=41840.00 loops=1)
                                 Output: t.id, mk.movie_id
                                 Inner Unique: true
                                 Buffers: shared hit=138768
                                 ->  Nested Loop  (cost=6.82..3764.68 rows=34 width=4) (actual time=2.433..25.656 rows=41840.00 loops=1)
                                       Output: mk.movie_id
                                       Buffers: shared hit=12528
                                       ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.256..5.047 rows=1.00 loops=1)
                                             Output: k.id, k.keyword, k.phonetic_code
                                             Filter: (k.keyword = 'character-name-in-title'::text)
                                             Rows Removed by Filter: 134169
                                             Buffers: shared hit=949
                                       ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.82..1135.48 rows=308 width=8) (actual time=2.176..18.325 rows=41840.00 loops=1)
                                             Output: mk.id, mk.movie_id, mk.keyword_id
                                             Recheck Cond: (k.id = mk.keyword_id)
                                             Heap Blocks: exact=11541
                                             Buffers: shared hit=11579
                                             ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.74 rows=308 width=0) (actual time=1.255..1.255 rows=41840.00 loops=1)
                                                   Index Cond: (mk.keyword_id = k.id)
                                                   Index Searches: 1
                                                   Buffers: shared hit=38
                                 ->  Index Only Scan using title_pkey on public.title t  (cost=0.43..0.46 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=41840)
                                       Output: t.id
                                       Index Cond: (t.id = mk.movie_id)
                                       Heap Fetches: 0
                                       Index Searches: 41840
                                       Buffers: shared hit=126240
                           ->  Index Scan using movie_id_cast_info on public.cast_info ci  (cost=0.44..1.40 rows=40 width=8) (actual time=0.002..0.020 rows=24.82 loops=41840)
                                 Output: ci.id, ci.person_id, ci.movie_id, ci.person_role_id, ci.note, ci.nr_order, ci.role_id
                                 Index Cond: (ci.movie_id = mk.movie_id)
                                 Index Searches: 41840
                                 Buffers: shared hit=1131706
                     ->  Index Scan using name_pkey on public.name n  (cost=0.43..0.46 rows=1 width=19) (actual time=0.002..0.002 rows=0.01 loops=1038393)
                           Output: n.id, n.name, n.imdb_index, n.imdb_id, n.gender, n.name_pcode_cf, n.name_pcode_nf, n.surname_pcode, n.md5sum
                           Index Cond: (n.id = ci.person_id)
                           Filter: (n.name ~~ 'Z%'::text)
                           Rows Removed by Filter: 1
                           Index Searches: 1038393
                           Buffers: shared hit=4153572
               ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.52 rows=5 width=8) (actual time=0.002..0.003 rows=7.88 loops=6642)
                     Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                     Index Cond: (mc.movie_id = ci.movie_id)
                     Index Searches: 6642
                     Buffers: shared hit=31450
         ->  Index Only Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.44 rows=1 width=4) (actual time=0.001..0.001 rows=1.00 loops=52306)
               Output: cn.id
               Index Cond: (cn.id = mc.company_id)
               Heap Fetches: 0
               Index Searches: 52306
               Buffers: shared hit=156919
 Planning:
   Buffers: shared hit=605
 Planning Time: 12.947 ms
 Execution Time: 3652.697 ms
(72 rows)

