Well, you might want to try the EXISTS version. I'm not sure if it'll be
faster or slower though. In theory it should be the same.
Hum, I didn't realize the principals table was the largest table. But Postgres
knew that so one would expect it to have found a better plan. The IN/EXISTS
handling was recently much improved but perhaps there's still room :)
WHERE EXISTS (
JOIN principals ON (groups.id = principals.objectid)
JOIN cachedgroupmembers ON (principals.id = cachedgroupmembers.groupid)
JOIN users ON (cachedgroupmembers.memberid = users.id)
WHERE lower(users.emailaddress) = 'mallah_rajesh(at)yahoo(dot)com'
AND groups.domain = 'RT::Ticket-Role'
AND groups.type = 'Requestor'
AND principals.principaltype = 'group'
AND groups.instance = tickets.id
AND type = 'ticket'
AND effectiveid = tickets.id
AND (status = 'new' OR status = 'open')
ORDER BY priority DESC
In response to
pgsql-performance by date
|Next:||From: Christopher Kings-Lynne||Date: 2003-10-31 01:38:12|
|Subject: Re: vacuum locking|
|Previous:||From: Nathan Scott||Date: 2003-10-30 22:12:21|
|Subject: Re: [linux-lvm] RE: [PERFORM] backup/restore - another ar ea.|