From: | Greg Stark <gsstark(at)mit(dot)edu> |
---|---|
To: | Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> |
Cc: | Greg Stark <gsstark(at)mit(dot)edu>, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-performance(at)postgresql(dot)org, Jesse Vincent <jesse(at)bestpractical(dot)com> |
Subject: | Re: Query puts 7.3.4 on endless loop but 7.4beta5 is fine. |
Date: | 2003-10-30 21:32:43 |
Message-ID: | 87ad7icsxw.fsf@stark.dyndns.tv |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> writes:
> Nopes the query are not Equiv , earlier one returns 4 rows and the below one
> none,
Sorry, i lowercased a string constant and dropped the lower() on email.
Try this:
SELECT *
FROM tickets
WHERE id IN (
SELECT groups.instance
FROM groups
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 type = 'ticket'
AND effectiveid = tickets.id
AND (status = 'new' OR status = 'open')
ORDER BY priority DESC
LIMIT 10;
--
greg
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Scott | 2003-10-30 22:12:21 | Re: [linux-lvm] RE: [PERFORM] backup/restore - another ar ea. |
Previous Message | scott.marlowe | 2003-10-30 20:08:50 | Re: Pg+Linux swap use |