========================================================
 Detailed Analysis for Query: 11b 
 Source File: 11b.sql
 Date: Sat Dec 20 11:04:28 CST 2025
========================================================


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

SET
SET
                                                                                        QUERY PLAN                                                                                         
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=3776.03..3776.04 rows=1 width=96) (actual time=23.572..23.574 rows=1.00 loops=1)
   Output: min(cn.name), min((lt.link)::text), min(t.title)
   Buffers: shared hit=29629
   ->  Nested Loop  (cost=8.37..3776.02 rows=1 width=48) (actual time=2.432..23.563 rows=14.00 loops=1)
         Output: cn.name, lt.link, t.title
         Inner Unique: true
         Join Filter: (ml.movie_id = t.id)
         Buffers: shared hit=29629
         ->  Nested Loop  (cost=7.94..3775.52 rows=1 width=43) (actual time=1.553..23.418 rows=102.00 loops=1)
               Output: cn.name, mc.movie_id, mk.movie_id, ml.movie_id, lt.link
               Inner Unique: true
               Join Filter: (ct.id = mc.company_type_id)
               Rows Removed by Join Filter: 1
               Buffers: shared hit=29221
               ->  Nested Loop  (cost=7.94..3774.45 rows=1 width=47) (actual time=1.548..23.344 rows=103.00 loops=1)
                     Output: cn.name, mc.movie_id, mc.company_type_id, mk.movie_id, ml.movie_id, lt.link
                     Inner Unique: true
                     Buffers: shared hit=29118
                     ->  Nested Loop  (cost=7.52..3774.00 rows=1 width=32) (actual time=1.321..22.817 rows=288.00 loops=1)
                           Output: mk.movie_id, mc.movie_id, mc.company_type_id, mc.company_id, ml.movie_id, lt.link
                           Join Filter: (mc.movie_id = ml.movie_id)
                           Buffers: shared hit=27966
                           ->  Nested Loop  (cost=7.09..3773.43 rows=1 width=20) (actual time=1.297..22.528 rows=64.00 loops=1)
                                 Output: mk.movie_id, ml.movie_id, lt.link
                                 Join Filter: (lt.id = ml.link_type_id)
                                 Rows Removed by Join Filter: 187
                                 Buffers: shared hit=27655
                                 ->  Seq Scan on public.link_type lt  (cost=0.00..1.23 rows=1 width=16) (actual time=0.010..0.016 rows=1.00 loops=1)
                                       Output: lt.id, lt.link
                                       Filter: ((lt.link)::text ~~ '%follows%'::text)
                                       Rows Removed by Filter: 17
                                       Buffers: shared hit=1
                                 ->  Nested Loop  (cost=7.09..3772.08 rows=10 width=12) (actual time=1.285..22.501 rows=251.00 loops=1)
                                       Output: mk.movie_id, ml.link_type_id, ml.movie_id
                                       Buffers: shared hit=27654
                                       ->  Nested Loop  (cost=6.80..3757.63 rows=34 width=4) (actual time=1.275..18.592 rows=10544.00 loops=1)
                                             Output: mk.movie_id
                                             Buffers: shared hit=6531
                                             ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.369..5.673 rows=1.00 loops=1)
                                                   Output: k.id, k.keyword, k.phonetic_code
                                                   Filter: (k.keyword = 'sequel'::text)
                                                   Rows Removed by Filter: 134169
                                                   Buffers: shared hit=949
                                             ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1128.44 rows=306 width=8) (actual time=0.906..12.395 rows=10544.00 loops=1)
                                                   Output: mk.id, mk.movie_id, mk.keyword_id
                                                   Recheck Cond: (k.id = mk.keyword_id)
                                                   Heap Blocks: exact=5570
                                                   Buffers: shared hit=5582
                                                   ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.487..0.487 rows=10544.00 loops=1)
                                                         Index Cond: (mk.keyword_id = k.id)
                                                         Index Searches: 1
                                                         Buffers: shared hit=12
                                       ->  Index Scan using movie_id_movie_link on public.movie_link ml  (cost=0.29..0.38 rows=5 width=8) (actual time=0.000..0.000 rows=0.02 loops=10544)
                                             Output: ml.id, ml.movie_id, ml.linked_movie_id, ml.link_type_id
                                             Index Cond: (ml.movie_id = mk.movie_id)
                                             Index Searches: 10544
                                             Buffers: shared hit=21123
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.54 rows=2 width=12) (actual time=0.004..0.004 rows=4.50 loops=64)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = mk.movie_id)
                                 Filter: (mc.note IS NULL)
                                 Rows Removed by Filter: 2
                                 Index Searches: 64
                                 Buffers: shared hit=311
                     ->  Index Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.46 rows=1 width=23) (actual time=0.002..0.002 rows=0.36 loops=288)
                           Output: cn.id, cn.name, cn.country_code, cn.imdb_id, cn.name_pcode_nf, cn.name_pcode_sf, cn.md5sum
                           Index Cond: (cn.id = mc.company_id)
                           Filter: (((cn.country_code)::text <> '[pl]'::text) AND ((cn.name ~~ '%Film%'::text) OR (cn.name ~~ '%Warner%'::text)))
                           Rows Removed by Filter: 1
                           Index Searches: 288
                           Buffers: shared hit=1152
               ->  Seq Scan on public.company_type ct  (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1.00 loops=103)
                     Output: ct.id, ct.kind
                     Filter: ((ct.kind)::text = 'production companies'::text)
                     Rows Removed by Filter: 1
                     Buffers: shared hit=103
         ->  Index Scan using title_pkey on public.title t  (cost=0.43..0.49 rows=1 width=21) (actual time=0.001..0.001 rows=0.14 loops=102)
               Output: t.id, t.title, t.imdb_index, t.kind_id, t.production_year, t.imdb_id, t.phonetic_code, t.episode_of_id, t.season_nr, t.episode_nr, t.series_years, t.md5sum
               Index Cond: (t.id = mk.movie_id)
               Filter: ((t.title ~~ '%Money%'::text) AND (t.production_year = 1998))
               Rows Removed by Filter: 1
               Index Searches: 102
               Buffers: shared hit=408
 Planning:
   Buffers: shared hit=608
 Planning Time: 2.655 ms
 Execution Time: 23.648 ms
(87 rows)


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

SET
SET
SET
                                                                                      QUERY PLAN                                                                                      
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=33680.62..33680.63 rows=1 width=96) (actual time=189.172..189.174 rows=1.00 loops=1)
   Output: min(cn.name), min((lt.link)::text), min(t.title)
   Buffers: shared hit=117283 read=79
   ->  Nested Loop  (cost=8.09..33680.61 rows=1 width=48) (actual time=27.116..189.146 rows=14.00 loops=1)
         Output: cn.name, lt.link, t.title
         Join Filter: (mk.movie_id = ml.movie_id)
         Rows Removed by Join Filter: 147602
         Buffers: shared hit=117283 read=79
         ->  Nested Loop  (cost=1.29..29922.56 rows=1 width=60) (actual time=25.783..30.957 rows=14.00 loops=1)
               Output: cn.name, mc.movie_id, lt.link, ml.movie_id, t.title, t.id
               Inner Unique: true
               Buffers: shared hit=25849 read=79
               ->  Nested Loop  (cost=0.87..29922.10 rows=1 width=45) (actual time=25.768..30.798 rows=21.00 loops=1)
                     Output: mc.movie_id, mc.company_id, lt.link, ml.movie_id, t.title, t.id
                     Join Filter: (ct.id = mc.company_type_id)
                     Buffers: shared hit=25765 read=79
                     ->  Seq Scan on public.company_type ct  (cost=0.00..1.05 rows=1 width=4) (actual time=0.005..0.007 rows=1.00 loops=1)
                           Output: ct.id, ct.kind
                           Filter: ((ct.kind)::text = 'production companies'::text)
                           Rows Removed by Filter: 3
                           Buffers: shared hit=1
                     ->  Nested Loop  (cost=0.87..29921.03 rows=2 width=49) (actual time=25.762..30.784 rows=21.00 loops=1)
                           Output: mc.movie_id, mc.company_type_id, mc.company_id, lt.link, ml.movie_id, t.title, t.id
                           Buffers: shared hit=25764 read=79
                           ->  Nested Loop  (cost=0.44..29917.36 rows=1 width=37) (actual time=25.742..30.704 rows=7.00 loops=1)
                                 Output: lt.link, ml.movie_id, t.title, t.id
                                 Join Filter: (lt.id = ml.link_type_id)
                                 Rows Removed by Join Filter: 12
                                 Buffers: shared hit=25729 read=79
                                 ->  Seq Scan on public.link_type lt  (cost=0.00..1.23 rows=1 width=16) (actual time=0.004..0.006 rows=1.00 loops=1)
                                       Output: lt.id, lt.link
                                       Filter: ((lt.link)::text ~~ '%follows%'::text)
                                       Rows Removed by Filter: 17
                                       Buffers: shared hit=1
                                 ->  Nested Loop  (cost=0.44..29916.12 rows=1 width=29) (actual time=25.733..30.693 rows=19.00 loops=1)
                                       Output: ml.link_type_id, ml.movie_id, t.title, t.id
                                       Inner Unique: true
                                       Buffers: shared hit=25728 read=79
                                       ->  Seq Scan on public.movie_link ml  (cost=0.00..462.97 rows=29997 width=8) (actual time=0.013..1.304 rows=29997.00 loops=1)
                                             Output: ml.id, ml.movie_id, ml.linked_movie_id, ml.link_type_id
                                             Buffers: shared hit=163
                                       ->  Memoize  (cost=0.44..4.49 rows=1 width=21) (actual time=0.001..0.001 rows=0.00 loops=29997)
                                             Output: t.title, t.id
                                             Cache Key: ml.movie_id
                                             Cache Mode: logical
                                             Estimates: capacity=6411 distinct keys=6411 lookups=29997 hit percent=78.63%
                                             Hits: 23586  Misses: 6411  Evictions: 0  Overflows: 0  Memory Usage: 426kB
                                             Buffers: shared hit=25565 read=79
                                             ->  Index Scan using title_pkey on public.title t  (cost=0.43..4.48 rows=1 width=21) (actual time=0.004..0.004 rows=0.00 loops=6411)
                                                   Output: t.title, t.id
                                                   Index Cond: (t.id = ml.movie_id)
                                                   Filter: ((t.title ~~ '%Money%'::text) AND (t.production_year = 1998))
                                                   Rows Removed by Filter: 1
                                                   Index Searches: 6411
                                                   Buffers: shared hit=25565 read=79
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..3.65 rows=2 width=12) (actual time=0.008..0.010 rows=3.00 loops=7)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = ml.movie_id)
                                 Filter: (mc.note IS NULL)
                                 Rows Removed by Filter: 1
                                 Index Searches: 7
                                 Buffers: shared hit=35
               ->  Index Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.46 rows=1 width=23) (actual time=0.007..0.007 rows=0.67 loops=21)
                     Output: cn.id, cn.name, cn.country_code, cn.imdb_id, cn.name_pcode_nf, cn.name_pcode_sf, cn.md5sum
                     Index Cond: (cn.id = mc.company_id)
                     Filter: (((cn.country_code)::text <> '[pl]'::text) AND ((cn.name ~~ '%Film%'::text) OR (cn.name ~~ '%Warner%'::text)))
                     Rows Removed by Filter: 0
                     Index Searches: 21
                     Buffers: shared hit=84
         ->  Nested Loop  (cost=6.80..3757.63 rows=34 width=4) (actual time=1.078..11.037 rows=10544.00 loops=14)
               Output: mk.movie_id
               Buffers: shared hit=91434
               ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.258..4.619 rows=1.00 loops=14)
                     Output: k.id, k.keyword, k.phonetic_code
                     Filter: (k.keyword = 'sequel'::text)
                     Rows Removed by Filter: 134169
                     Buffers: shared hit=13286
               ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1128.44 rows=306 width=8) (actual time=0.816..5.907 rows=10544.00 loops=14)
                     Output: mk.id, mk.movie_id, mk.keyword_id
                     Recheck Cond: (k.id = mk.keyword_id)
                     Heap Blocks: exact=77980
                     Buffers: shared hit=78148
                     ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.411..0.411 rows=10544.00 loops=14)
                           Index Cond: (mk.keyword_id = k.id)
                           Index Searches: 14
                           Buffers: shared hit=168
 Planning:
   Buffers: shared hit=608
 Planning Time: 1.805 ms
 Execution Time: 189.243 ms
(90 rows)


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

SET
SET
                                                                                        QUERY PLAN                                                                                         
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=3776.04..3776.05 rows=1 width=96) (actual time=22.618..22.621 rows=1.00 loops=1)
   Output: min(cn.name), min((lt.link)::text), min(t.title)
   Buffers: shared hit=29127
   ->  Nested Loop  (cost=8.37..3776.03 rows=1 width=48) (actual time=1.977..22.609 rows=14.00 loops=1)
         Output: cn.name, lt.link, t.title
         Inner Unique: true
         Buffers: shared hit=29127
         ->  Nested Loop  (cost=7.95..3775.58 rows=1 width=33) (actual time=1.964..22.571 rows=21.00 loops=1)
               Output: lt.link, mc.company_id, t.title
               Inner Unique: true
               Join Filter: (ml.movie_id = t.id)
               Buffers: shared hit=29043
               ->  Nested Loop  (cost=7.52..3775.07 rows=1 width=28) (actual time=1.323..22.230 rows=269.00 loops=1)
                     Output: mk.movie_id, ml.movie_id, lt.link, mc.movie_id, mc.company_id
                     Join Filter: (ct.id = mc.company_type_id)
                     Rows Removed by Join Filter: 19
                     Buffers: shared hit=27967
                     ->  Seq Scan on public.company_type ct  (cost=0.00..1.05 rows=1 width=4) (actual time=0.012..0.013 rows=1.00 loops=1)
                           Output: ct.id, ct.kind
                           Filter: ((ct.kind)::text = 'production companies'::text)
                           Rows Removed by Filter: 3
                           Buffers: shared hit=1
                     ->  Nested Loop  (cost=7.52..3774.00 rows=2 width=32) (actual time=1.309..22.199 rows=288.00 loops=1)
                           Output: mk.movie_id, ml.movie_id, lt.link, mc.movie_id, mc.company_type_id, mc.company_id
                           Join Filter: (mc.movie_id = ml.movie_id)
                           Buffers: shared hit=27966
                           ->  Nested Loop  (cost=7.09..3773.43 rows=1 width=20) (actual time=1.290..21.949 rows=64.00 loops=1)
                                 Output: mk.movie_id, ml.movie_id, lt.link
                                 Join Filter: (lt.id = ml.link_type_id)
                                 Rows Removed by Join Filter: 187
                                 Buffers: shared hit=27655
                                 ->  Seq Scan on public.link_type lt  (cost=0.00..1.23 rows=1 width=16) (actual time=0.007..0.012 rows=1.00 loops=1)
                                       Output: lt.id, lt.link
                                       Filter: ((lt.link)::text ~~ '%follows%'::text)
                                       Rows Removed by Filter: 17
                                       Buffers: shared hit=1
                                 ->  Nested Loop  (cost=7.09..3772.08 rows=10 width=12) (actual time=1.282..21.928 rows=251.00 loops=1)
                                       Output: mk.movie_id, ml.link_type_id, ml.movie_id
                                       Buffers: shared hit=27654
                                       ->  Nested Loop  (cost=6.80..3757.63 rows=34 width=4) (actual time=1.272..18.104 rows=10544.00 loops=1)
                                             Output: mk.movie_id
                                             Buffers: shared hit=6531
                                             ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=1 width=4) (actual time=0.366..5.362 rows=1.00 loops=1)
                                                   Output: k.id, k.keyword, k.phonetic_code
                                                   Filter: (k.keyword = 'sequel'::text)
                                                   Rows Removed by Filter: 134169
                                                   Buffers: shared hit=949
                                             ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1128.44 rows=306 width=8) (actual time=0.904..12.210 rows=10544.00 loops=1)
                                                   Output: mk.id, mk.movie_id, mk.keyword_id
                                                   Recheck Cond: (k.id = mk.keyword_id)
                                                   Heap Blocks: exact=5570
                                                   Buffers: shared hit=5582
                                                   ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.486..0.486 rows=10544.00 loops=1)
                                                         Index Cond: (mk.keyword_id = k.id)
                                                         Index Searches: 1
                                                         Buffers: shared hit=12
                                       ->  Index Scan using movie_id_movie_link on public.movie_link ml  (cost=0.29..0.38 rows=5 width=8) (actual time=0.000..0.000 rows=0.02 loops=10544)
                                             Output: ml.id, ml.movie_id, ml.linked_movie_id, ml.link_type_id
                                             Index Cond: (ml.movie_id = mk.movie_id)
                                             Index Searches: 10544
                                             Buffers: shared hit=21123
                           ->  Index Scan using movie_id_movie_companies on public.movie_companies mc  (cost=0.43..0.54 rows=2 width=12) (actual time=0.003..0.004 rows=4.50 loops=64)
                                 Output: mc.id, mc.movie_id, mc.company_id, mc.company_type_id, mc.note
                                 Index Cond: (mc.movie_id = mk.movie_id)
                                 Filter: (mc.note IS NULL)
                                 Rows Removed by Filter: 2
                                 Index Searches: 64
                                 Buffers: shared hit=311
               ->  Index Scan using title_pkey on public.title t  (cost=0.43..0.49 rows=1 width=21) (actual time=0.001..0.001 rows=0.08 loops=269)
                     Output: t.id, t.title, t.imdb_index, t.kind_id, t.production_year, t.imdb_id, t.phonetic_code, t.episode_of_id, t.season_nr, t.episode_nr, t.series_years, t.md5sum
                     Index Cond: (t.id = mk.movie_id)
                     Filter: ((t.title ~~ '%Money%'::text) AND (t.production_year = 1998))
                     Rows Removed by Filter: 1
                     Index Searches: 269
                     Buffers: shared hit=1076
         ->  Index Scan using company_name_pkey on public.company_name cn  (cost=0.42..0.46 rows=1 width=23) (actual time=0.002..0.002 rows=0.67 loops=21)
               Output: cn.id, cn.name, cn.country_code, cn.imdb_id, cn.name_pcode_nf, cn.name_pcode_sf, cn.md5sum
               Index Cond: (cn.id = mc.company_id)
               Filter: (((cn.country_code)::text <> '[pl]'::text) AND ((cn.name ~~ '%Film%'::text) OR (cn.name ~~ '%Warner%'::text)))
               Rows Removed by Filter: 0
               Index Searches: 21
               Buffers: shared hit=84
 Planning:
   Buffers: shared hit=608
 Planning Time: 13.518 ms
 Execution Time: 22.703 ms
(86 rows)

