Re: Join query on 1M row table slow

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Join query on 1M row table slow
Date: 2004-02-10 23:06:07
Message-ID: Pine.LNX.4.33.0402101604470.29982-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 10 Feb 2004, CSN wrote:

> > So, can you get rid of the join / in on the other
> > table, or do you need it there?
>
> No - each product can fall under multiple categories,
> so I need the product_categories table (and the join
> on it).

Oh, ok. then we might have as efficient a query as we're gonna get.

Oh, another thing is to make your select in the in() clause a select
distinct and see if that helps. If you've got a whole bunch of duplicates
running around in it it's sometimes faster to distinct it. Then again,
given all the work Tom's been putting in the query planner / optimization,
he may have already done something like that.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message CSN 2004-02-10 23:07:13 Re: Join query on 1M row table slow
Previous Message scott.marlowe 2004-02-10 22:48:50 Re: DB cache size strategies