pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pierre@desertmoon.com
To: daveh@insightdist.com
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Joining bug????
Date: 27 Oct 1998 12:04:56 -0700
Message-ID: <19981027190456.19036.qmail@desertmoon.com> (raw)
In-Reply-To: <36360F15.9CD6A1B@insightdist.com>

> 
> Nice query.   You mentioned having indexes on id columns etc.    Are the indices
> single column, or multi-column?   You may want to consider making some of them
> multi-column.   The EXPLAIN does indicate usage of your indices, but it may not be
> optimal.   If the distribution of your data in the indices is such that the each
> index scan must go through large chunks of data to qualify the other attributes in
> the join, it will run slow.   By adding some well placed multi-part indices, the
> index scans will be narrower in their scan sets.    Or not.
> 

My apologies I should have been a bit more specific. The indices are multi 
column, _id first prod_id second. Also  A search for just the keyword
photoshop returns just 35 or so values. I was under the impression that postgresql
used the bottom up method of optimization. I.e. the most narrow criteria
should be declared last, why doesn't the explain show the use of the keyword 
first?

> Also,  I could be wrong, but, I have found even batch loaded data needs a VACUUM
> ANALYZE to gather distributions statistics.

I'll try just about anything at this point....oh...and most of these tables 
have been clustered by their major indexes.

-=pierre




view thread (16+ messages)  latest in thread

Message-ID: <19981027190456.19036.qmail@desertmoon.com>
Permalink:  ../19981027190456.19036.qmail@desertmoon.com/
Also on:    postgresql.org/message-id/19981027190456.19036.qmail@desertmoon.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pierre@desertmoon.com, daveh@insightdist.com
  Subject: Re: [SQL] Joining bug????
  In-Reply-To: <19981027190456.19036.qmail@desertmoon.com>
  References: <36360F15.9CD6A1B@insightdist.com> <19981027190456.19036.qmail@desertmoon.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox