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 3 of 5 Topic 4004 of 4424
Post > Topic >>

Re: Message queue table..

by jesper@[EMAIL PROTECTED] (Jesper Krogh) Apr 18, 2008 at 09:23 PM

Craig Ringer wrote:
> Jesper Krogh wrote:
>>
>> Hi.
>>
>> 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).
>>
>> Can anyone digest further optimizations out of this output? (All 
>> records have funcid=4)
> 
> You mean all records of interest, right, not all records in the table?

Actually all the records.. since all the other virtual queues currently 
are empty.

> What indexes do you have in place? What's the schema? Can you post a "\d

> tablename" from psql?
> 
>> # explain analyze SELECT job.jobid, job.funcid, job.arg, job.uniqkey, 
>> job.insert_time, job.run_after, job.grabbed_until, job.priority, 
>> job.coalesce FROM workqueue.job  WHERE (job.funcid = 4) AND 
>> (job.run_after <= 1208442668) AND (job.grabbed_until <= 1208442668) 
>> AND (job.coalesce = 'Efam') ORDER BY funcid, priority ASC LIMIT 1

I found that removing the funcid from the order by made it use a better 
index. (priority, run_after, grabbed_until)  that probably makes sense 
since the funcid doesnt give any value in the index at all.

thanks for leading me back on track.

Jesper

-- 
Jesper

-- 
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 Mon Dec 1 8:18:11 CST 2008.