-> Bitmap Index
Scan on idx_gnl_char_lang_char_id (cost=0.00..4.29 rows=2 width=0) (actual
time=0.003..0.003 rows=2 loops=1)
Index Cond:
(char_id = gnl_char.char_id)
-> Index Scan using
idx_prod_char_val_v02 on prod_char_val (cost=0.56..19213.05 rows=1237
width=88) (actual time=0.018..140.837 rows=188944 loops=1)
Index Cond: (char_id =
gnl_char_lang.char_id)
Filter: (((val)::text =
'xxx'::text) OR ((val)::text = 'xxx'::text))
Rows Removed by Filter:
3986
-> Index Scan using gnl_st_pkey on
gnl_st charvalstatus (cost=0.15..0.17 rows=1 width=11) (actual
time=0.001..0.001 rows=1 loops=188944)
Index Cond: (gnl_st_id =
prod_char_val.st_id)
Filter: ((shrt_code)::text =
ANY ('{ACTV,PNDG}'::text[]))
Rows Removed by Filter: 0
-> Index Scan using pk_prod on prod
(cost=0.43..1.91 rows=1 width=21) (actual time=0.003..0.003 rows=1 loops=101354)
Index Cond: (prod_id =
prod_char_val.prod_id)
-> Index Scan using gnl_st_pkey on gnl_st
prodstatus (cost=0.15..0.17 rows=1 width=5) (actual time=0.001..0.001 rows=1
loops=101354)
Index Cond: (gnl_st_id = prod.st_id)
Filter: ((shrt_code)::text = ANY
('{ACTV,PNDG}'::text[]))
Rows Removed by Filter: 0
-> Index Scan using gnl_char_val_pkey on
gnl_char_val (cost=0.15..0.17 rows=1 width=20) (actual time=0.001..0.001
rows=1 loops=99005)
Index Cond: (char_val_id =
prod_char_val.char_val_id)
-> Index Scan using idx_gcvl_char_val_id on
gnl_char_val_lang (cost=0.28..0.32 rows=1 width=14) (actual time=0.001..0.002
rows=1 loops=99005)
Index Cond: (char_val_id = prod_char_val.char_val_id)
Filter: ((is_actv = '1'::numeric) AND ((lang)::text =
'en'::text))
Rows Removed by Filter: 1
-> Index Scan using pk_prod on prod prodentity0_
(cost=0.43..0.60 rows=1 width=6197) (actual time=0.002..0.002 rows=1
loops=99005)
Index Cond: (prod_id = prod.prod_id)
Planning time: 6.947 ms
Execution time: 1661.278 ms
This is the view;
create or replace
view bss.v_prod_char_val as select
prod_char_val.prod_char_val_id,
prod_char_val.prod_id,
prod_char_val.char_id,
prod_char_val.char_val_id,
prod_char_val.val,
prod_char_val.trnsc_id,
prod_char_val.sdate,
prod_char_val.edate,
prod_char_val.st_id,
prod_char_val.cdate,
prod_char_val.cuser,
prod_char_val.udate,
prod_char_val.uuser,
gnl_char_lang.name as char_name,
gnl_char_val_lang.val_lbl as char_val_name,
charvalstatus.shrt_code as prod_char_val_st_shrt_code,
gnl_char_val_lang.lang,
gnl_char.shrt_code,
gnl_char_val.shrt_code as char_val_shrt_code,
prod.bill_acct_id
from
bss.prod_char_val
left join bss.prod on
prod.prod_id = prod_char_val.prod_id,
bss.gnl_st prodstatus,
bss.gnl_char
left join bss.gnl_char_lang on
gnl_char_lang.char_id = gnl_char.char_id,
bss.gnl_char_val
left join bss.gnl_char_val_lang on
gnl_char_val_lang.char_val_id = gnl_char_val.char_val_id,
bss.gnl_st charvalstatus
where
prod.st_id = prodstatus.gnl_st_id
and (prodstatus.shrt_code::text = any (array['ACTV'::character
varying::text,
'PNDG'::character varying::text]))
and gnl_char_val_lang.is_actv = 1::numeric
and gnl_char_lang.is_actv = 1::numeric
and gnl_char_lang.lang::text = gnl_char_val_lang.lang::text
and prod_char_val.char_id = gnl_char.char_id
and prod_char_val.char_val_id = gnl_char_val.char_val_id
and prod_char_val.st_id = charvalstatus.gnl_st_id
and (charvalstatus.shrt_code::text = any (array['ACTV'::character
varying::text,
'PNDG'::character varying::text]));
[http://www.etiya.com/images/e-newsletter/signature/e_logo_1.png]
[http://www.etiya.com/images/e-newsletter/signature/e_adres.png]<http://www.etiya.com>
[http://www.etiya.com/images/e-newsletter/signature/facebook_icon.png]<https://www.facebook.com/Etiya-249050755136326/>