Re: [PERFORM] QUERY PLANNER - Indexe mono column VS composite Index

2015-07-10 Thread Jeff Janes
On Fri, Jul 10, 2015 at 2:34 AM, Nicolas Paris wrote: > > > =3: without a constraint on tval_char => seq > scan > > > EXPLAIN ANALYSE select f.patient_num > from i2b2data_multi_nomi.observation_fact f > where > f.co

Re: [PERFORM] QUERY PLANNER - Indexe mono column VS composite Index

2015-07-10 Thread Nicolas Paris
Ok, here is the problem (it's different than what I explained before) ==INDEX == CREATE INDEX of_idx_modifier ON i2b2data_multi_nomi.observation_fact USING btree (concept_cd COLLATE pg_catalog."default", modifier_cd COLLATE pg_catalog."default", valtype_cd COLLATE pg_catalog."default", tval_c

Re: [PERFORM] QUERY PLANNER - Indexe mono column VS composite Index

2015-07-09 Thread Guillaume Lelarge
2015-07-09 22:34 GMT+02:00 Nicolas Paris : > Hello, > > My 9.4 database is used as datawharehouse. I can't change the queries > generated. > > first index : INDEX COL (A,B,C,D,E) > > > In case of query based on COL A, the query planner sometimes go to a seq > scan instead of using the first comp

[PERFORM] QUERY PLANNER - Indexe mono column VS composite Index

2015-07-09 Thread Nicolas Paris
Hello, My 9.4 database is used as datawharehouse. I can't change the queries generated. first index : INDEX COL (A,B,C,D,E) In case of query based on COL A, the query planner sometimes go to a seq scan instead of using the first composite index. The solution is to add a second indexe (redond