Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine.

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: vacuum locking
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: vacuum locking