Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: Message que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 4004 of 4352
Post > Topic >>

Re: Message queue table..

by tgl@[EMAIL PROTECTED] (Tom Lane) Apr 18, 2008 at 03:27 PM

Jesper Krogh <jesper@[EMAIL PROTECTED]
> writes:
> I have this "message queue" table.. currently with 8m+ records. Picking 
> the top priority messages seem to take quite long.. it is just a matter 
> of searching the index.. (just as explain analyze tells me it does).

>   Limit  (cost=0.00..0.09 rows=1 width=106) (actual 
> time=245.273..245.274 rows=1 loops=1)
>     ->  Index Scan using workqueue_job_funcid_priority_idx on job 
> (cost=0.00..695291.80 rows=8049405 width=106) (actual 
> time=245.268..245.268 rows=1 loops=1)
>           Index Cond: (funcid = 4)
>           Filter: ((run_after <= 1208442668) AND (grabbed_until <= 
> 1208442668) AND ("coalesce" = 'Efam'::text))
>   Total runtime: 245.330 ms

Well, what that's doing in English is: scan all the rows with funcid =
4, in priority order, until we hit the first one satisfying the filter
conditions.  Apparently there are a lot of low-priority rows that have
funcid = 4 but not the other conditions.

If it's the "coalesce" condition that's the problem, an index on
(funcid, coalesce, priority) --- or (coalesce, funcid, priority) ---
would probably help.  I'm not sure there's a simple fix if it's
the other conditions that are really selective.

			regards, tom lane

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 5 Posts in Topic:
Message queue table..
jesper@[EMAIL PROTECTED]   2008-04-18 19:49:39 
Re: Message queue table..
craig@[EMAIL PROTECTED]   2008-04-19 02:18:40 
Re: Message queue table..
jesper@[EMAIL PROTECTED]   2008-04-18 21:23:09 
Re: Message queue table..
tgl@[EMAIL PROTECTED] (T  2008-04-18 15:27:02 
Re: Message queue table..
Chris Browne <cbbrowne  2008-04-18 15:57:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 20:19:48 CDT 2008.