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


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

SET
SET
                                                                                       QUERY PLAN                                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=16645.68..16645.69 rows=1 width=32) (actual time=140.455..140.456 rows=1.00 loops=1)
   Output: min(t.title)
   Buffers: shared hit=65756 read=183
   ->  Nested Loop  (cost=7.67..16645.68 rows=1 width=17) (actual time=12.612..140.440 rows=5.00 loops=1)
         Output: t.title
         Join Filter: (mi.movie_id = t.id)
         Buffers: shared hit=65756 read=183
         ->  Nested Loop  (cost=7.23..16547.29 rows=68 width=25) (actual time=4.260..112.172 rows=405.00 loops=1)
               Output: mk.movie_id, t.title, t.id
               Inner Unique: true
               Buffers: shared hit=59696 read=136
               ->  Nested Loop  (cost=6.80..16332.76 rows=438 width=4) (actual time=2.125..59.308 rows=12951.00 loops=1)
                     Output: mk.movie_id
                     Buffers: shared hit=7906 read=122
                     ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=13 width=4) (actual time=0.689..11.915 rows=30.00 loops=1)
                           Output: k.id, k.keyword, k.phonetic_code
                           Filter: (k.keyword ~~ '%sequel%'::text)
                           Rows Removed by Filter: 134140
                           Buffers: shared hit=949
                     ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1051.30 rows=306 width=8) (actual time=0.201..1.555 rows=431.70 loops=30)
                           Output: mk.id, mk.movie_id, mk.keyword_id
                           Recheck Cond: (k.id = mk.keyword_id)
                           Heap Blocks: exact=6979
                           Buffers: shared hit=6957 read=122
                           ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.182..0.182 rows=431.70 loops=30)
                                 Index Cond: (mk.keyword_id = k.id)
                                 Index Searches: 30
                                 Buffers: shared hit=58 read=42
               ->  Index Scan using title_pkey on public.title t  (cost=0.43..0.49 rows=1 width=21) (actual time=0.004..0.004 rows=0.03 loops=12951)
                     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.production_year > 2010)
                     Rows Removed by Filter: 1
                     Index Searches: 12951
                     Buffers: shared hit=51790 read=14
         ->  Index Scan using movie_id_movie_info on public.movie_info mi  (cost=0.43..1.43 rows=1 width=4) (actual time=0.068..0.070 rows=0.01 loops=405)
               Output: mi.id, mi.movie_id, mi.info_type_id, mi.info, mi.note
               Index Cond: (mi.movie_id = mk.movie_id)
               Filter: (mi.info = 'Bulgaria'::text)
               Rows Removed by Filter: 63
               Index Searches: 405
               Buffers: shared hit=6060 read=47
 Planning:
   Buffers: shared hit=407
 Planning Time: 1.013 ms
 Execution Time: 140.506 ms
(46 rows)


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

SET
SET
SET
                                                                                          QUERY PLAN                                                                                           
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=367341.34..367341.35 rows=1 width=32) (actual time=1673.246..1673.248 rows=1.00 loops=1)
   Output: min(t.title)
   Buffers: shared hit=146244 read=32573
   ->  Nested Loop  (cost=7.23..367341.34 rows=1 width=17) (actual time=1503.748..1673.224 rows=5.00 loops=1)
         Output: t.title
         Join Filter: (mk.movie_id = t.id)
         Rows Removed by Join Filter: 2939872
         Buffers: shared hit=146244 read=32573
         ->  Nested Loop  (cost=6.80..16332.76 rows=438 width=4) (actual time=1.600..25.470 rows=12951.00 loops=1)
               Output: mk.movie_id
               Buffers: shared hit=8028
               ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=13 width=4) (actual time=0.633..10.355 rows=30.00 loops=1)
                     Output: k.id, k.keyword, k.phonetic_code
                     Filter: (k.keyword ~~ '%sequel%'::text)
                     Rows Removed by Filter: 134140
                     Buffers: shared hit=949
               ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1051.30 rows=306 width=8) (actual time=0.045..0.480 rows=431.70 loops=30)
                     Output: mk.id, mk.movie_id, mk.keyword_id
                     Recheck Cond: (k.id = mk.keyword_id)
                     Heap Blocks: exact=6979
                     Buffers: shared hit=7079
                     ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.025..0.025 rows=431.70 loops=30)
                           Index Cond: (mk.keyword_id = k.id)
                           Index Searches: 30
                           Buffers: shared hit=100
         ->  Materialize  (cost=0.43..350627.67 rows=58 width=25) (actual time=0.008..0.120 rows=227.00 loops=12951)
               Output: mi.movie_id, t.title, t.id
               Storage: Memory  Maximum Storage: 28kB
               Buffers: shared hit=138216 read=32573
               ->  Nested Loop  (cost=0.43..350627.38 rows=58 width=25) (actual time=98.376..1496.629 rows=227.00 loops=1)
                     Output: mi.movie_id, t.title, t.id
                     Inner Unique: true
                     Buffers: shared hit=138216 read=32573
                     ->  Seq Scan on public.movie_info mi  (cost=0.00..347456.83 rows=379 width=4) (actual time=92.526..1479.378 rows=2287.00 loops=1)
                           Output: mi.id, mi.movie_id, mi.info_type_id, mi.info, mi.note
                           Filter: (mi.info = 'Bulgaria'::text)
                           Rows Removed by Filter: 14833433
                           Buffers: shared hit=129095 read=32546
                     ->  Index Scan using title_pkey on public.title t  (cost=0.43..8.37 rows=1 width=21) (actual time=0.007..0.007 rows=0.10 loops=2287)
                           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 = mi.movie_id)
                           Filter: (t.production_year > 2010)
                           Rows Removed by Filter: 1
                           Index Searches: 2287
                           Buffers: shared hit=9121 read=27
 Planning:
   Buffers: shared hit=407
 Planning Time: 0.956 ms
 Execution Time: 1674.067 ms
(49 rows)


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

SET
SET
                                                                                       QUERY PLAN                                                                                        
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=16645.68..16645.69 rows=1 width=32) (actual time=65.409..65.411 rows=1.00 loops=1)
   Output: min(t.title)
   Buffers: shared hit=65939
   ->  Nested Loop  (cost=7.67..16645.68 rows=1 width=17) (actual time=4.690..65.395 rows=5.00 loops=1)
         Output: t.title
         Join Filter: (mi.movie_id = t.id)
         Buffers: shared hit=65939
         ->  Nested Loop  (cost=7.23..16547.29 rows=68 width=25) (actual time=2.358..55.941 rows=405.00 loops=1)
               Output: t.title, t.id, mk.movie_id
               Inner Unique: true
               Buffers: shared hit=59832
               ->  Nested Loop  (cost=6.80..16332.76 rows=438 width=4) (actual time=1.531..23.953 rows=12951.00 loops=1)
                     Output: mk.movie_id
                     Buffers: shared hit=8028
                     ->  Seq Scan on public.keyword k  (cost=0.00..2626.12 rows=13 width=4) (actual time=0.590..10.258 rows=30.00 loops=1)
                           Output: k.id, k.keyword, k.phonetic_code
                           Filter: (k.keyword ~~ '%sequel%'::text)
                           Rows Removed by Filter: 134140
                           Buffers: shared hit=949
                     ->  Bitmap Heap Scan on public.movie_keyword mk  (cost=6.80..1051.30 rows=306 width=8) (actual time=0.043..0.432 rows=431.70 loops=30)
                           Output: mk.id, mk.movie_id, mk.keyword_id
                           Recheck Cond: (k.id = mk.keyword_id)
                           Heap Blocks: exact=6979
                           Buffers: shared hit=7079
                           ->  Bitmap Index Scan on keyword_id_movie_keyword  (cost=0.00..6.73 rows=306 width=0) (actual time=0.025..0.025 rows=431.70 loops=30)
                                 Index Cond: (mk.keyword_id = k.id)
                                 Index Searches: 30
                                 Buffers: shared hit=100
               ->  Index Scan using title_pkey on public.title t  (cost=0.43..0.49 rows=1 width=21) (actual time=0.002..0.002 rows=0.03 loops=12951)
                     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.production_year > 2010)
                     Rows Removed by Filter: 1
                     Index Searches: 12951
                     Buffers: shared hit=51804
         ->  Index Scan using movie_id_movie_info on public.movie_info mi  (cost=0.43..1.43 rows=1 width=4) (actual time=0.023..0.023 rows=0.01 loops=405)
               Output: mi.id, mi.movie_id, mi.info_type_id, mi.info, mi.note
               Index Cond: (mi.movie_id = mk.movie_id)
               Filter: (mi.info = 'Bulgaria'::text)
               Rows Removed by Filter: 63
               Index Searches: 405
               Buffers: shared hit=6107
 Planning:
   Buffers: shared hit=407
 Planning Time: 1.810 ms
 Execution Time: 65.474 ms
(46 rows)

