From: | David Wheeler <david(at)kineticode(dot)com> |
---|---|
To: | josh(at)agliodbs(dot)com |
Cc: | sfpug(at)postgresql(dot)org |
Subject: | Re: Aggregate |
Date: | 2003-03-04 03:35:22 |
Message-ID: | 54711644-4DF2-11D7-B98B-0003931A964A@kineticode.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | sfpug |
On Monday, March 3, 2003, at 01:33 PM, Josh Berkus wrote:
> Try this:
>
> SELECT DISTINCT a.id
> FROM site a, member m, site_member c, member m3, member m4,
> site_member c3, user_member um,
> grp_priv__grp_member gm
> WHERE a.id = c.object_id
> AND c.member__id = m.id
> AND m.active = 1
> AND a.id = c3.object_id
> AND c3.member__id = m3.id
> AND m3.active = 1
> AND m3.grp__id = gm.grp__id
> AND gm.grp_priv__id = gp.id
> AND gp.value < 4
> AND gp.grp__id = m4.grp__id
> AND m4.id = um.member__id
> AND um.object_id = 1
> AND NOT EXISTS ( select id from grp_priv gp4
> WHERE gm.grp_priv__id = gp4.id
> AND gp4.value = 4)
> ORDER BY a.id
>
> ... though I'm a little baffled by your join structure, so I'm not
> sure the
> crieteria in the EXISTS clause are right.
Naw, that didn't work. I thin that the subquery will have to link all
those tables *again*. :-(
> You should also make sure that your GEQO threshold on your server is
> set
> higher than the default. I usually set mine to 24.
Say what? Sounds like something I should add to Bric::DBA, eh?
http://bricolage.cc/docs/Bric/DBA.html
Regards,
David
--
David Wheeler AIM: dwTheory
david(at)kineticode(dot)com ICQ: 15726394
Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org
Kineticode. Setting knowledge in motion.[sm]
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2003-03-04 04:44:51 | Re: Aggregate |
Previous Message | David Wheeler | 2003-03-04 03:30:25 | Re: Aggregate |