After VACUUM FULL ANALYZE - Short Query --------------------------------------- Index Scan Backward using scf_stokkart_pkey on scf_stokkart stok (cost=0.00..392045.63 rows=9998 width=166) (actual time=0.661..4431.568 rows=10000 loops=1) Filter: (((_key)::text ~~ '00%'::text) OR ((_key)::text ~~ '01%'::text) OR ((_key)::text ~~ '$$%'::text)) SubPlan -> Aggregate (cost=39.16..39.16 rows=1 width=10) (actual time=0.416..0.418 rows=1 loops=10000) InitPlan -> Index Scan using scf_stokkart_birimleri_key_scf_stokkart_idx on scf_stokkart_birimleri birim (cost=0.00..5.25 rows=2 width=28) (actual time=0.101..0.105 rows=1 loops=10000) Index Cond: ((_key_scf_stokkart)::text = ($1)::text) Filter: (anabirim = '1'::bpchar) SubPlan -> Limit (cost=1.08..1.09 rows=1 width=15) (actual time=0.048..0.050 rows=1 loops=10000) -> Sort (cost=1.08..1.09 rows=2 width=15) (actual time=0.043..0.043 rows=1 loops=10000) Sort Key: tarih -> Seq Scan on sis_doviz_kuru kur (cost=0.00..1.07 rows=2 width=15) (actual time=0.009..0.026 rows=2 loops=10000) Filter: (($0)::text = (_key_sis_doviz)::text) -> Nested Loop (cost=0.00..33.90 rows=1 width=10) (actual time=0.295..0.295 rows=0 loops=10000) -> Seq Scan on scf_irsaliye irs (cost=0.00..30.00 rows=1 width=20) (actual time=0.290..0.290 rows=0 loops=10000) Filter: (((karsifirma)::text = 'KENDI'::text) AND (((turu)::text = 'MAI'::text) OR ((turu)::text = 'KGI'::text) OR ((turu)::text = 'PS'::text) OR ((turu)::text = 'TS'::text) OR ((turu)::text = 'KC'::text) OR ((turu)::text = 'KCO'::text)) AND (((_key_sis_depo_dest)::text = '$$$$0000003l$1$$'::text) OR ((_key_sis_depo_dest)::text = '$$$$00000048$1$$'::text) OR ((_key_sis_depo_dest)::text = '$$$$0000004b$1$$'::text) OR ((_key_sis_depo_dest)::text = '$$$$0000004d$1$$'::text)) AND (tarih <= '2005-08-26'::date)) -> Index Scan using scf_irsaliye_kalemi_key_scf_irsaliye_idx on scf_irsaliye_kalemi irskal (cost=0.00..3.89 rows=1 width=30) (never executed) Index Cond: ((irskal._key_scf_irsaliye)::text = ("outer"._key)::text) Filter: (((_key_kalemturu)::text = ($1)::text) AND (((_key)::text ~~ '0000%'::text) OR ((_key)::text ~~ '0101%'::text) OR ((_key)::text ~~ '$$%'::text))) Total runtime: 4456.895 ms