[PERFORM] Query plan for views and WHERE clauses, Luke is not using the index
От | kimaidou |
---|---|
Тема | [PERFORM] Query plan for views and WHERE clauses, Luke is not using the index |
Дата | |
Msg-id | CAMKXKO7VXEEWfvsAYyWiAzca=fgAh6eSOU4V+BHUyz7uxJseWg@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [PERFORM] Query plan for views and WHERE clauses, Luke is not using the index
Re: [PERFORM] Query plan for views and WHERE clauses, Luke is notusing the index |
Список | pgsql-performance |
Hi all,
I have come across a unexpected behavior.http://paste.debian.net/982003/
WHERE "progression_geometry" && st_makeenvelope(1728327.03249295568093657,8240789.26074041239917278,1728608.10987572139129043,8240958.16933418624103069,3949)
See the query plan:
EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS)
SELECT *
FROM "qgep"."vw_qgep_reach"
WHERE "progression_geometry" && st_makeenvelope(1728327.03249295568093657,8240789.26074041239917278,1728608.10987572139129043,8240958.16933418624103069,3949)
The query plan is "wrong", as PostgreSQL seems to consider it should do a seq scan on the tables, and only afterwards filter with the WHERE:
The query takes about 1 second instead of less than 100ms.
Do you have any hint on this kind of issue ?
Thanks in advance
Regards,
Michaël
В списке pgsql-performance по дате отправления: