NOTICE: QUERY PLAN: Nested Loop (cost=94.60..199.12 rows=1 width=148) InitPlan -> Seq Scan on cardtypes (cost=0.00..1.14 rows=1 width=2) -> Nested Loop (cost=93.17..160.81 rows=1 width=130) -> Nested Loop (cost=93.17..151.95 rows=1 width=112) -> Nested Loop (cost=73.59..131.84 rows=1 width=98) -> Nested Loop (cost=72.49..123.45 rows=1 width=84) -> Nested Loop (cost=15.67..66.45 rows=1 width=70) -> Nested Loop (cost=15.67..64.42 rows=1 width=66) -> Nested Loop (cost=15.67..62.39 rows=1 width=62) -> Nested Loop (cost=15.67..60.36 rows=1 width=48) -> Nested Loop (cost=15.67..58.95 rows=1 width=34) -> Hash Join (cost=15.67..55.83 rows=2 width=20) -> Nested Loop (cost=0.00..34.54 rows=127 width=18) -> Seq Scan on cardtypes c (cost=0.00..1.11 rows=11 width=14) -> Index Scan using cards_cardtypes2_index on cards_cardtypes ct (cost=0.00..3.02 rows=1 width=4) -> Hash (cost=15.57..15.57 rows=42 width=2) -> Index Scan using cards_cardtypes2_index on cards_cardtypes (cost=0.00..15.57 rows=42 width=2) -> Index Scan using cards_pkey on cards c (cost=0.00..2.01 rows=1 width=14) -> Seq Scan on cards_names (cost=0.00..1.18 rows=18 width=14) -> Index Scan using cards_cardtexts_index on cards_cardtexts (cost=0.00..2.01 rows=1 width=14) -> Index Scan using cards_capacities_index on cards_capacities (cost=0.00..2.01 rows=1 width=4) -> Index Scan using cards_costs_index on cards_costs (cost=0.00..2.01 rows=1 width=4) -> Subquery Scan t_disciplines (cost=56.82..56.96 rows=3 width=19) -> Aggregate (cost=56.82..56.96 rows=3 width=19) -> Group (cost=56.82..56.89 rows=29 width=19) -> Sort (cost=56.82..56.82 rows=29 width=19) -> Nested Loop (cost=0.00..56.11 rows=29 width=19) -> Seq Scan on disciplines d (cost=0.00..1.27 rows=27 width=14) -> Index Scan using cards_disciplines2_index on cards_disciplines cd (cost=0.00..2.02 rows=1 width=5) -> Subquery Scan t_titles (cost=1.10..8.26 rows=10 width=18) -> Hash Join (cost=1.10..8.26 rows=10 width=18) -> Seq Scan on cards_titles ct (cost=0.00..2.15 rows=115 width=4) -> Hash (cost=1.08..1.08 rows=8 width=14) -> Seq Scan on titles t (cost=0.00..1.08 rows=8 width=14) -> Subquery Scan t_sets (cost=19.58..19.94 rows=7 width=18) -> Aggregate (cost=19.58..19.94 rows=7 width=18) -> Group (cost=19.58..19.76 rows=73 width=18) -> Sort (cost=19.58..19.58 rows=73 width=18) -> Nested Loop (cost=0.00..17.33 rows=73 width=18) -> Seq Scan on sets s (cost=0.00..1.08 rows=8 width=14) -> Index Scan using cards_sets2_index on cards_sets cs (cost=0.00..2.02 rows=1 width=4) -> Materialize (cost=7.12..7.12 rows=70 width=18) -> Nested Loop (cost=0.00..7.12 rows=70 width=18) -> Seq Scan on sects s (cost=0.00..1.03 rows=3 width=14) -> Index Scan using cards_sects2_index on cards_sects cs (cost=0.00..2.02 rows=1 width=4) -> Materialize (cost=38.17..38.17 rows=5 width=18) -> Hash Join (cost=1.43..38.17 rows=5 width=18) -> Seq Scan on cards_clans cc (cost=0.00..10.14 rows=614 width=4) -> Hash (cost=1.34..1.34 rows=34 width=14) -> Seq Scan on clans c (cost=0.00..1.34 rows=34 width=14) EXPLAIN