Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine.
В списке pgsql-performance по дате отправления:
| От | Greg Stark |
|---|---|
| Тема | Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. |
| Дата | |
| Msg-id | 87znfid1ya.fsf@stark.dyndns.tv обсуждение |
| Ответ на | Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. (Rajesh Kumar Mallah <mallah@trade-india.com>) |
| Список | pgsql-performance |
Rajesh Kumar Mallah <mallah@trade-india.com> writes:
> -> Seq Scan on tickets main (cost=0.00..465.62 rows=1 width=164)
> Filter: ((effectiveid = id) AND (("type")::text = 'ticket'::text) AND (((status)::text = 'new'::text) OR
((status)::text= 'open'::text)))
This query has to read through every ticket in the system and check if the
current user has access to it? It seems like this isn't going to be a terribly
fast query no matter how you slice it.
One thing that might help keep its run-time from growing is a partial index
WHERE type = 'ticket' and (status = 'new' OR status = 'open')
(I'm not sure what the point of the effectiveid=id clause is)
That at least might help when 99% of your tickets are old closed tickets. But
it will still have to scan through every new and open ticket which on some
systems could be a large number.
--
greg
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера