Skip site navigation (1) Skip section navigation (2)

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

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: Christopher Browne <cbbrowne(at)acm(dot)org>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine.
Date: 2003-10-30 18:18:05
Message-ID: 87znfid1ya.fsf@stark.dyndns.tv (view raw or flat)
Thread:
Lists: pgsql-performance
Rajesh Kumar Mallah <mallah(at)trade-india(dot)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


In response to

pgsql-performance by date

Next:From: Josh BerkusDate: 2003-10-30 18:21:06
Subject: Re: vacuum locking
Previous:From: scott.marloweDate: 2003-10-30 17:55:32
Subject: Re: vacuum locking

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group