Re: [PERFORM] Slow-ish Query Needs Some Love

2010-02-04 Thread Robert Haas
On Mon, Feb 1, 2010 at 7:53 PM, Matt White wrote: > I have a relatively straightforward query that by itself isn't that > slow, but we have to run it up to 40 times on one webpage load, so it > needs to run much faster than it does. Here it is: > > SELECT COUNT(*) FROM users, user_groups >  WHERE

Re: [PERFORM] Slow-ish Query Needs Some Love

2010-02-03 Thread Andy Colson
On 2/3/2010 11:17 AM, Matt White wrote: On Feb 2, 1:11 pm, a...@squeakycode.net (Andy Colson) wrote: On 2/2/2010 1:03 PM, Matt White wrote: On Feb 2, 6:06 am, Edgardo Portalwrote: On 2010-02-02, Matt Whitewrote: I have a relatively straightforward query that by itself isn't tha

[PERFORM] Slow-ish Query Needs Some Love

2010-02-02 Thread Matt White
I have a relatively straightforward query that by itself isn't that slow, but we have to run it up to 40 times on one webpage load, so it needs to run much faster than it does. Here it is: SELECT COUNT(*) FROM users, user_groups WHERE users.user_group_id = user_groups.id AND NOT users.deleted AND

Re: [PERFORM] Slow-ish Query Needs Some Love

2010-02-02 Thread Edgardo Portal
On 2010-02-02, Matt White wrote: > I have a relatively straightforward query that by itself isn't that > slow, but we have to run it up to 40 times on one webpage load, so it > needs to run much faster than it does. Here it is: > > SELECT COUNT(*) FROM users, user_groups > WHERE users.user_group_

Re: [PERFORM] Slow-ish Query Needs Some Love

2010-02-02 Thread Matt White
On Feb 2, 6:06 am, Edgardo Portal wrote: > On 2010-02-02, Matt White wrote: > > > I have a relatively straightforward query that by itself isn't that > > slow, but we have to run it up to 40 times on one webpage load, so it > > needs to run much faster than it does. Here it is: > > > SELECT COUNT

Re: [PERFORM] Slow-ish Query Needs Some Love

2010-02-02 Thread Andy Colson
On 2/2/2010 1:03 PM, Matt White wrote: On Feb 2, 6:06 am, Edgardo Portal wrote: On 2010-02-02, Matt White wrote: I have a relatively straightforward query that by itself isn't that slow, but we have to run it up to 40 times on one webpage load, so it needs to run much faster than it does. He