default_statistics_target=700 (bad plan) Hash Join (cost=16773308.60..82433071.21 rows=18200167 width=27) (actual time=66330.619..66330.619 rows=0 loops=1)" " Hash Cond: (av1.number_value = av_1.card_id)" " Join Filter: (SubPlan 2)" " -> Bitmap Heap Scan on attribute_value av1 (cost=4568706.91..13354005.00 rows=545981533 width=23) (actual time=66327.191..66327.191 rows=1 loops=1)" " Recheck Cond: (number_value IS NOT NULL)" " Heap Blocks: exact=1" " -> Bitmap Index Scan on xif8number_value (cost=0.00..4432211.53 rows=244924709 width=0) (actual time=61346.173..61346.173 rows=248556906 loops=1)" " -> Hash (cost=12200971.35..12200971.35 rows=290427 width=37) (actual time=0.041..0.041 rows=0 loops=1)" " Buckets: 524288 Batches: 1 Memory Usage: 4096kB" " -> Merge Join (cost=2834039.76..12200971.35 rows=290427 width=37) (actual time=0.041..0.041 rows=0 loops=1)" " Merge Cond: ((a_2.attribute_code)::text = (ao_1.attribute_code)::text)" " Join Filter: (SubPlan 1)" " -> Nested Loop (cost=2807242.54..12172087.09 rows=580855 width=65) (actual time=0.034..0.034 rows=0 loops=1)" " -> Merge Join (cost=46.87..46.91 rows=1 width=46) (actual time=0.033..0.033 rows=0 loops=1)" " Merge Cond: ((a_2.attribute_code)::text = (ao1.attribute_code)::text)" " -> Sort (cost=18.88..18.89 rows=1 width=21) (actual time=0.031..0.031 rows=0 loops=1)" " Sort Key: a_2.attribute_code" " Sort Method: quicksort Memory: 25kB" " -> Nested Loop (cost=1.11..18.87 rows=1 width=21) (actual time=0.018..0.018 rows=0 loops=1)" " -> Nested Loop (cost=0.84..13.02 rows=9 width=18) (actual time=0.017..0.017 rows=0 loops=1)" " -> Index Only Scan using card_and_status_idx on card c_2 (cost=0.56..8.58 rows=1 width=11) (actual time=0.016..0.016 rows=0 loops=1)" " Index Cond: (card_id = '0'::numeric)" " Heap Fetches: 0" " -> Index Only Scan using xpktemplate_block on template_block tb_1 (cost=0.28..4.38 rows=6 width=17) (never executed)" " Index Cond: (template_id = c_2.template_id)" " Heap Fetches: 0" " -> Index Scan using xif1attribute on attribute a_2 (cost=0.28..0.64 rows=1 width=27) (never executed)" " Index Cond: ((block_code)::text = (tb_1.block_code)::text)" " Filter: ((data_type = 'B'::bpchar) AND ((attribute_code)::text = ANY ('{ADMIN_702311,JBR_HOWFAST,_STATE,ADMIN_6849958,_PRELIMINARY_TERM,_ALL_DOCLINKS,JBR_INCOMEDATE,JBR_RASSM_PARENT_ (...)" " -> Sort (cost=27.99..28.00 rows=4 width=25) (never executed)" " Sort Key: ao1.attribute_code" " -> Bitmap Heap Scan on attribute_option ao1 (cost=23.69..27.95 rows=4 width=25) (never executed)" " Recheck Cond: ((option_code)::text = 'UPLINK'::text)" " -> Bitmap Index Scan on xpkattribute_option (cost=0.00..23.69 rows=4 width=0) (never executed)" " Index Cond: ((option_code)::text = 'UPLINK'::text)" " -> Bitmap Heap Scan on attribute_value av_1 (cost=2807195.67..10825909.73 rows=134613045 width=23) (never executed)" " Recheck Cond: (number_value = '0'::numeric)" " -> Bitmap Index Scan on xif8number_value (cost=0.00..2773542.41 rows=134613045 width=0) (never executed)" " Index Cond: (number_value = '0'::numeric)" " -> Sort (cost=29.69..29.82 rows=49 width=25) (never executed)" " Sort Key: ao_1.attribute_code" " -> Bitmap Heap Scan on attribute_option ao_1 (cost=23.70..28.32 rows=49 width=25) (never executed)" " Recheck Cond: ((option_code)::text = 'LINK'::text)" " -> Bitmap Index Scan on xpkattribute_option (cost=0.00..23.69 rows=49 width=0) (never executed)" " Index Cond: ((option_code)::text = 'LINK'::text)"