Re: [PERFORM] Query plan for views and WHERE clauses, Luke is not using the index

2017-08-22 Thread kimaidou
Thanks a lot for your detailed explanation. I will try ASAP with no DISTINCT ( we are quite sure it is not needed anyway ), and report back here. Michaƫl 2017-08-21 23:52 GMT+02:00 David Rowley : > On 19 August 2017 at 04:46, kimaidou wrote: > > When we call the WHERE on the view: > > > > EXPLA

Re: [PERFORM] Query plan for views and WHERE clauses, Luke is not using the index

2017-08-21 Thread David Rowley
On 19 August 2017 at 04:46, kimaidou wrote: > When we call the WHERE on the view: > > EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS) > SELECT * > FROM "qgep"."vw_qgep_reach" > WHERE "progression_geometry" && > st_makeenvelope(1728327.03249295568093657,8240789.26074041239917278,1728608.1098757213912904

Re: [PERFORM] Query plan for views and WHERE clauses, Luke is not using the index

2017-08-21 Thread kimaidou
Hi all I also tried to change the values of join_collapse_limit and rom_collapse_limit to higher values than default: 12, 50 or even 100, with no improvement on the query plan. Is this a typical behavior, or is there something particular in my query that causes this big difference between the raw

[PERFORM] Query plan for views and WHERE clauses, Luke is not using the index

2017-08-18 Thread kimaidou
Hi all, I have come across a unexpected behavior. You can see full detail on an issue on the QGEP project in Github : https://github.com/QGEP/QGEP/issues/308#issuecomment-323122514 Basically, we have this view with some LEFT JOIN : http://paste.debian.net/982003/ We have indexes on some fields (