19a === Aggregate (cost=1281926.91..1281926.92 rows=1 width=64) -> Nested Loop (cost=385632.06..1281926.90 rows=1 width=32) Join Filter: (mi.movie_id = t.id) -> Nested Loop (cost=385631.63..1281925.46 rows=1 width=27) -> Nested Loop (cost=385631.21..1281924.25 rows=1 width=31) Join Filter: (mi.movie_id = mc.movie_id) -> Nested Loop (cost=385631.21..1220451.91 rows=1 width=23) -> Nested Loop (cost=385630.78..1220450.99 rows=1 width=27) Join Filter: (n.id = an.person_id) -> Nested Loop (cost=385630.78..1188774.78 rows=1 width=35) -> Hash Join (cost=385630.35..1188317.05 rows=290 width=16) Hash Cond: (ci.movie_id = mi.movie_id) -> Hash Join (cost=1.16..799611.25 rows=74514 width=12) Hash Cond: (ci.role_id = rt.id) -> Seq Scan on cast_info ci (cost=0.00..796433.94 rows=894162 width=16) Filter: ((note)::text = ANY ('{(voice),"(voice: Japanese version)","(voice) (uncredited)","(voice: English version)"}'::text[])) -> Hash (cost=1.15..1.15 rows=1 width=4) -> Seq Scan on role_type rt (cost=0.00..1.15 rows=1 width=4) Filter: ((role)::text = 'actress'::text) -> Hash (cost=385577.39..385577.39 rows=4144 width=4) -> Hash Join (cost=2.43..385577.39 rows=4144 width=4) Hash Cond: (mi.info_type_id = it.id) -> Seq Scan on movie_info mi (cost=0.00..384299.61 rows=468286 width=8) Filter: ((info IS NOT NULL) AND (((info)::text ~~ 'Japan:%200%'::text) OR ((info)::text ~~ 'USA:%200%'::text))) -> Hash (cost=2.41..2.41 rows=1 width=4) -> Seq Scan on info_type it (cost=0.00..2.41 rows=1 width=4) Filter: ((info)::text = 'release dates'::text) -> Index Scan using name_pkey on name n (cost=0.43..1.58 rows=1 width=19) Index Cond: (id = ci.person_id) Filter: (((name)::text ~~ '%Ang%'::text) AND ((gender)::text = 'f'::text)) -> Seq Scan on aka_name an (cost=0.00..20409.43 rows=901343 width=4) -> Index Only Scan using char_name_pkey on char_name chn (cost=0.43..0.91 rows=1 width=4) Index Cond: (id = ci.person_role_id) -> Seq Scan on movie_companies mc (cost=0.00..57926.93 rows=283633 width=8) Filter: ((note IS NOT NULL) AND (((note)::text ~~ '%(USA)%'::text) OR ((note)::text ~~ '%(worldwide)%'::text))) -> Index Scan using company_name_pkey on company_name cn (cost=0.42..1.21 rows=1 width=4) Index Cond: (id = mc.company_id) Filter: ((country_code)::text = '[us]'::text) -> Index Scan using title_pkey on title t (cost=0.43..1.43 rows=1 width=21) Index Cond: (id = ci.movie_id) Filter: ((production_year >= 2005) AND (production_year <= 2009)) (41 rows) 23b === Aggregate (cost=530960.64..530960.65 rows=1 width=64) -> Nested Loop (cost=6198.10..530960.64 rows=1 width=27) -> Nested Loop (cost=6197.97..530960.47 rows=1 width=21) Join Filter: (mi.movie_id = t.id) -> Nested Loop (cost=6197.54..530959.96 rows=1 width=16) -> Nested Loop (cost=6197.41..530959.81 rows=1 width=20) -> Nested Loop (cost=6196.99..530959.36 rows=1 width=24) Join Filter: (mk.movie_id = mi.movie_id) -> Nested Loop (cost=3235.39..446427.08 rows=1 width=20) Join Filter: (mi.movie_id = mc.movie_id) -> Nested Loop (cost=0.00..384304.13 rows=1 width=4) Join Filter: (it1.id = mi.info_type_id) -> Seq Scan on info_type it1 (cost=0.00..2.41 rows=1 width=4) Filter: ((info)::text = 'release dates'::text) -> Seq Scan on movie_info mi (cost=0.00..384299.61 rows=169 width=8) Filter: (((note)::text ~~ '%internet%'::text) AND ((info)::text ~~ 'USA:% 200%'::text)) -> Hash Join (cost=3235.39..59777.37 rows=187646 width=16) Hash Cond: (mc.movie_id = cc.movie_id) -> Seq Scan on movie_companies mc (cost=0.00..44881.29 rows=2609129 width=12) -> Hash (cost=2813.24..2813.24 rows=33772 width=4) -> Hash Join (cost=1.06..2813.24 rows=33772 width=4) Hash Cond: (cc.status_id = cct1.id) -> Seq Scan on complete_cast cc (cost=0.00..2081.86 rows=135086 width=8) -> Hash (cost=1.05..1.05 rows=1 width=4) -> Seq Scan on comp_cast_type cct1 (cost=0.00..1.05 rows=1 width=4) Filter: ((kind)::text = 'complete+verified'::text) -> Hash Join (cost=2961.60..84530.59 rows=135 width=4) Hash Cond: (mk.keyword_id = k.id) -> Seq Scan on movie_keyword mk (cost=0.00..69693.30 rows=4523930 width=8) -> Hash (cost=2961.55..2961.55 rows=4 width=4) -> Seq Scan on keyword k (cost=0.00..2961.55 rows=4 width=4) Filter: ((keyword)::text = ANY ('{nerd,loner,alienation,dignity}'::text[])) -> Index Scan using company_name_pkey on company_name cn (cost=0.42..0.45 rows=1 width=4) Index Cond: (id = mc.company_id) Filter: ((country_code)::text = '[us]'::text) -> Index Only Scan using company_type_pkey on company_type ct (cost=0.13..0.15 rows=1 width=4) Index Cond: (id = mc.company_type_id) -> Index Scan using title_pkey on title t (cost=0.43..0.49 rows=1 width=25) Index Cond: (id = mk.movie_id) Filter: (production_year > 2000) -> Index Scan using kind_type_pkey on kind_type kt (cost=0.13..0.15 rows=1 width=14) Index Cond: (id = t.kind_id) Filter: ((kind)::text = 'movie'::text) (43 rows) 29a === Aggregate (cost=1406522.78..1406522.79 rows=1 width=96) -> Nested Loop (cost=1319861.07..1406522.77 rows=1 width=48) -> Hash Join (cost=1319860.64..1406518.69 rows=2 width=52) Hash Cond: (mk.movie_id = t.id) -> Seq Scan on movie_keyword mk (cost=0.00..69693.30 rows=4523930 width=8) -> Hash (cost=1319860.62..1319860.62 rows=1 width=68) -> Nested Loop (cost=875040.22..1319860.62 rows=1 width=68) -> Nested Loop (cost=875040.07..1319860.44 rows=1 width=72) -> Nested Loop (cost=875039.93..1319860.26 rows=1 width=76) Join Filter: (t.id = mi.movie_id) -> Nested Loop (cost=875039.93..929707.07 rows=1 width=68) -> Hash Join (cost=875039.51..929705.05 rows=1 width=72) Hash Cond: (mc.movie_id = t.id) -> Seq Scan on movie_companies mc (cost=0.00..44881.29 rows=2609129 width=8) -> Hash (cost=875039.50..875039.50 rows=1 width=64) -> Nested Loop (cost=783048.18..875039.50 rows=1 width=64) Join Filter: (ci.person_id = n.id) -> Nested Loop (cost=783047.75..875037.26 rows=1 width=61) -> Hash Join (cost=783047.32..874925.38 rows=50 width=40) Hash Cond: (pi.person_id = ci.person_id) -> Seq Scan on person_info pi (cost=0.00..80743.59 rows=2969059 width=8) -> Hash (cost=783047.29..783047.29 rows=2 width=32) -> Hash Join (cost=759257.80..783047.29 rows=2 width=32) Hash Cond: (an.person_id = ci.person_id) -> Seq Scan on aka_name an (cost=0.00..20409.43 rows=901343 width=4) -> Hash (cost=759257.79..759257.79 rows=1 width=28) -> Nested Loop (cost=3238.04..759257.79 rows=1 width=28) -> Hash Join (cost=3237.61..757973.37 rows=570 width=16) Hash Cond: (cc.subject_id = cct1.id) -> Hash Join (cost=3236.55..757959.98 rows=2281 width=20) Hash Cond: (ci.role_id = rt.id) -> Hash Join (cost=3235.39..757861.59 rows=27374 width=24) Hash Cond: (ci.movie_id = cc.movie_id) -> Seq Scan on cast_info ci (cost=0.00..751121.70 rows=861537 width=16) Filter: ((note)::text = ANY ('{(voice),"(voice) (uncredited)","(voice: English version)"}'::text[])) -> Hash (cost=2813.24..2813.24 rows=33772 width=8) -> Hash Join (cost=1.06..2813.24 rows=33772 width=8) Hash Cond: (cc.status_id = cct2.id) -> Seq Scan on complete_cast cc (cost=0.00..2081.86 rows=135086 width=12) -> Hash (cost=1.05..1.05 rows=1 width=4) -> Seq Scan on comp_cast_type cct2 (cost=0.00..1.05 rows=1 width=4) Filter: ((kind)::text = 'complete+verified'::text) -> Hash (cost=1.15..1.15 rows=1 width=4) -> Seq Scan on role_type rt (cost=0.00..1.15 rows=1 width=4) Filter: ((role)::text = 'actress'::text) -> Hash (cost=1.05..1.05 rows=1 width=4) -> Seq Scan on comp_cast_type cct1 (cost=0.00..1.05 rows=1 width=4) Filter: ((kind)::text = 'cast'::text) -> Index Scan using char_name_pkey on char_name chn (cost=0.43..2.25 rows=1 width=20) Index Cond: (id = ci.person_role_id) Filter: ((name)::text = 'Queen'::text) -> Index Scan using title_pkey on title t (cost=0.43..2.23 rows=1 width=21) Index Cond: (id = ci.movie_id) Filter: ((production_year >= 2000) AND (production_year <= 2010) AND ((title)::text = 'Shrek 2'::text)) -> Index Scan using name_pkey on name n (cost=0.43..2.22 rows=1 width=19) Index Cond: (id = pi.person_id) Filter: (((name)::text ~~ '%An%'::text) AND ((gender)::text = 'f'::text)) -> Index Scan using company_name_pkey on company_name cn (cost=0.42..2.03 rows=1 width=4) Index Cond: (id = mc.company_id) Filter: ((country_code)::text = '[us]'::text) -> Seq Scan on movie_info mi (cost=0.00..384299.61 rows=468286 width=8) Filter: ((info IS NOT NULL) AND (((info)::text ~~ 'Japan:%200%'::text) OR ((info)::text ~~ 'USA:%200%'::text))) -> Index Scan using info_type_pkey on info_type it (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = mi.info_type_id) Filter: ((info)::text = 'release dates'::text) -> Index Scan using info_type_pkey on info_type it3 (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = pi.info_type_id) Filter: ((info)::text = 'trivia'::text) -> Memoize (cost=0.43..2.03 rows=1 width=4) Cache Key: mk.keyword_id Cache Mode: logical -> Index Scan using keyword_pkey on keyword k (cost=0.42..2.02 rows=1 width=4) Index Cond: (id = mk.keyword_id) Filter: ((keyword)::text = 'computer-animation'::text) (74 rows) 29c === Aggregate (cost=1444338.40..1444338.41 rows=1 width=96) -> Nested Loop (cost=1352407.09..1444338.39 rows=1 width=48) -> Nested Loop (cost=1352406.94..1444338.21 rows=1 width=52) Join Filter: (ci.person_id = n.id) -> Nested Loop (cost=1352406.51..1444335.98 rows=1 width=49) -> Nested Loop (cost=1352406.37..1444334.49 rows=9 width=53) -> Hash Join (cost=1352405.95..1444283.76 rows=25 width=57) Hash Cond: (pi.person_id = ci.person_id) -> Seq Scan on person_info pi (cost=0.00..80743.59 rows=2969059 width=8) -> Hash (cost=1352405.94..1352405.94 rows=1 width=49) -> Hash Join (cost=1297740.40..1352405.94 rows=1 width=49) Hash Cond: (mc.movie_id = t.id) -> Seq Scan on movie_companies mc (cost=0.00..44881.29 rows=2609129 width=8) -> Hash (cost=1297740.39..1297740.39 rows=1 width=65) -> Nested Loop (cost=907913.81..1297740.39 rows=1 width=65) -> Nested Loop (cost=907913.68..1297740.22 rows=1 width=69) -> Nested Loop (cost=907913.55..1297740.05 rows=1 width=73) Join Filter: (t.id = cc.movie_id) -> Nested Loop (cost=907913.55..1293969.62 rows=1 width=61) -> Hash Join (cost=907913.42..1293969.13 rows=3 width=65) Hash Cond: (mi.movie_id = t.id) -> Seq Scan on movie_info mi (cost=0.00..384299.61 rows=468286 width=8) Filter: ((info IS NOT NULL) AND (((info)::text ~~ 'Japan:%200%'::text) OR ((info)::text ~~ 'USA:%200%'::text))) -> Hash (cost=907913.23..907913.23 rows=15 width=57) -> Nested Loop (cost=884048.56..907913.23 rows=15 width=57) Join Filter: (ci.movie_id = t.id) -> Hash Join (cost=884048.13..907837.95 rows=35 width=36) Hash Cond: (an.person_id = ci.person_id) -> Seq Scan on aka_name an (cost=0.00..20409.43 rows=901343 width=4) -> Hash (cost=884047.96..884047.96 rows=14 width=32) -> Nested Loop (cost=84195.99..884047.96 rows=14 width=32) -> Hash Join (cost=84195.56..883982.89 rows=29 width=20) Hash Cond: (ci.movie_id = mk.movie_id) -> Seq Scan on cast_info ci (cost=0.00..796433.94 rows=894162 width=16) Filter: ((note)::text = ANY ('{(voice),"(voice: Japanese version)","(voice) (uncredited)","(voice: English version)"}'::text[])) -> Hash (cost=84195.13..84195.13 rows=34 width=4) -> Hash Join (cost=2626.14..84195.13 rows=34 width=4) Hash Cond: (mk.keyword_id = k.id) -> Seq Scan on movie_keyword mk (cost=0.00..69693.30 rows=4523930 width=8) -> Hash (cost=2626.12..2626.12 rows=1 width=4) -> Seq Scan on keyword k (cost=0.00..2626.12 rows=1 width=4) Filter: ((keyword)::text = 'computer-animation'::text) -> Index Scan using char_name_pkey on char_name chn (cost=0.43..2.24 rows=1 width=20) Index Cond: (id = ci.person_role_id) -> Index Scan using title_pkey on title t (cost=0.43..2.14 rows=1 width=21) Index Cond: (id = mk.movie_id) Filter: ((production_year >= 2000) AND (production_year <= 2010)) -> Index Scan using role_type_pkey on role_type rt (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = ci.role_id) Filter: ((role)::text = 'actress'::text) -> Seq Scan on complete_cast cc (cost=0.00..2081.86 rows=135086 width=12) -> Index Scan using comp_cast_type_pkey on comp_cast_type cct1 (cost=0.13..0.15 rows=1 width=4) Index Cond: (id = cc.subject_id) Filter: ((kind)::text = 'cast'::text) -> Index Scan using comp_cast_type_pkey on comp_cast_type cct2 (cost=0.13..0.15 rows=1 width=4) Index Cond: (id = cc.status_id) Filter: ((kind)::text = 'complete+verified'::text) -> Index Scan using company_name_pkey on company_name cn (cost=0.42..2.03 rows=1 width=4) Index Cond: (id = mc.company_id) Filter: ((country_code)::text = '[us]'::text) -> Index Scan using info_type_pkey on info_type it (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = mi.info_type_id) Filter: ((info)::text = 'release dates'::text) -> Index Scan using name_pkey on name n (cost=0.43..2.22 rows=1 width=19) Index Cond: (id = pi.person_id) Filter: (((name)::text ~~ '%An%'::text) AND ((gender)::text = 'f'::text)) -> Index Scan using info_type_pkey on info_type it3 (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = pi.info_type_id) Filter: ((info)::text = 'trivia'::text) (69 rows) 30a === Aggregate (cost=1308994.86..1308994.87 rows=1 width=128) -> Nested Loop (cost=114548.73..1308994.85 rows=1 width=82) Join Filter: (mi.movie_id = t.id) -> Nested Loop (cost=114548.30..1308993.98 rows=1 width=85) -> Nested Loop (cost=114548.17..1308993.81 rows=1 width=89) -> Nested Loop (cost=114548.03..1308993.63 rows=1 width=93) Join Filter: (mi_idx.movie_id = mi.movie_id) -> Nested Loop (cost=114548.03..960971.11 rows=1 width=41) -> Hash Join (cost=114547.60..960970.02 rows=1 width=30) Hash Cond: (ci.movie_id = mi_idx.movie_id) -> Seq Scan on cast_info ci (cost=0.00..841746.19 rows=1246993 width=8) Filter: ((note)::text = ANY ('{(writer),"(head writer)","(written by)",(story),"(story editor)"}'::text[])) -> Hash (cost=114547.59..114547.59 rows=1 width=22) -> Nested Loop (cost=111958.95..114547.59 rows=1 width=22) -> Hash Join (cost=111958.82..114547.27 rows=2 width=26) Hash Cond: (cc.movie_id = mi_idx.movie_id) -> Seq Scan on complete_cast cc (cost=0.00..2081.86 rows=135086 width=12) -> Hash (cost=111958.74..111958.74 rows=6 width=14) -> Hash Join (cost=85039.14..111958.74 rows=6 width=14) Hash Cond: (mi_idx.info_type_id = it2.id) -> Hash Join (cost=85036.72..111954.37 rows=717 width=18) Hash Cond: (mi_idx.movie_id = mk.movie_id) -> Seq Scan on movie_info_idx mi_idx (cost=0.00..21735.35 rows=1380035 width=14) -> Hash (cost=85033.77..85033.77 rows=236 width=4) -> Hash Join (cost=3464.78..85033.77 rows=236 width=4) Hash Cond: (mk.keyword_id = k.id) -> Seq Scan on movie_keyword mk (cost=0.00..69693.30 rows=4523930 width=8) -> Hash (cost=3464.69..3464.69 rows=7 width=4) -> Seq Scan on keyword k (cost=0.00..3464.69 rows=7 width=4) Filter: ((keyword)::text = ANY ('{murder,violence,blood,gore,death,female-nudity,hospital}'::text[])) -> Hash (cost=2.41..2.41 rows=1 width=4) -> Seq Scan on info_type it2 (cost=0.00..2.41 rows=1 width=4) Filter: ((info)::text = 'votes'::text) -> Index Scan using comp_cast_type_pkey on comp_cast_type cct1 (cost=0.13..0.15 rows=1 width=4) Index Cond: (id = cc.subject_id) Filter: ((kind)::text = ANY ('{cast,crew}'::text[])) -> Index Scan using name_pkey on name n (cost=0.43..1.09 rows=1 width=19) Index Cond: (id = ci.person_id) Filter: ((gender)::text = 'm'::text) -> Seq Scan on movie_info mi (cost=0.00..347250.68 rows=61748 width=52) Filter: ((info)::text = ANY ('{Horror,Thriller}'::text[])) -> Index Scan using info_type_pkey on info_type it1 (cost=0.14..0.16 rows=1 width=4) Index Cond: (id = mi.info_type_id) Filter: ((info)::text = 'genres'::text) -> Index Scan using comp_cast_type_pkey on comp_cast_type cct2 (cost=0.13..0.15 rows=1 width=4) Index Cond: (id = cc.status_id) Filter: ((kind)::text = 'complete+verified'::text) -> Index Scan using title_pkey on title t (cost=0.43..0.85 rows=1 width=21) Index Cond: (id = mk.movie_id) Filter: (production_year > 2000) (50 rows) 7b == Aggregate (cost=877500.57..877500.58 rows=1 width=64) -> Nested Loop (cost=8020.63..877500.56 rows=1 width=32) Join Filter: (n.id = an.person_id) -> Nested Loop (cost=8020.63..847340.60 rows=1 width=44) Join Filter: (pi.person_id = n.id) -> Nested Loop (cost=8020.20..847340.13 rows=1 width=25) Join Filter: (pi.person_id = ci.person_id) -> Nested Loop (cost=0.00..88169.03 rows=1 width=4) Join Filter: (it.id = pi.info_type_id) -> Seq Scan on info_type it (cost=0.00..2.41 rows=1 width=4) Filter: ((info)::text = 'mini biography'::text) -> Seq Scan on person_info pi (cost=0.00..88166.24 rows=30 width=8) Filter: ((note)::text = 'Volker Boehm'::text) -> Hash Join (cost=8020.20..759149.20 rows=1752 width=21) Hash Cond: (ci.movie_id = t.id) -> Seq Scan on cast_info ci (cost=0.00..615184.96 rows=36249796 width=8) -> Hash (cost=8019.56..8019.56 rows=51 width=25) -> Nested Loop (cost=1.67..8019.56 rows=51 width=25) -> Hash Join (cost=1.24..561.48 rows=1666 width=4) Hash Cond: (ml.link_type_id = lt.id) -> Seq Scan on movie_link ml (cost=0.00..462.97 rows=29997 width=8) -> Hash (cost=1.23..1.23 rows=1 width=4) -> Seq Scan on link_type lt (cost=0.00..1.23 rows=1 width=4) Filter: ((link)::text = 'features'::text) -> Index Scan using title_pkey on title t (cost=0.43..4.48 rows=1 width=21) Index Cond: (id = ml.linked_movie_id) Filter: ((production_year >= 1980) AND (production_year <= 1984)) -> Index Scan using name_pkey on name n (cost=0.43..0.46 rows=1 width=19) Index Cond: (id = ci.person_id) Filter: (((name_pcode_cf)::text ~~ 'D%'::text) AND ((gender)::text = 'm'::text)) -> Seq Scan on aka_name an (cost=0.00..22662.79 rows=599774 width=4) Filter: ((name)::text ~~ '%a%'::text) (32 rows)