pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Hartwig <daveh@insightdist.com>
To: pierre <pierre@desertmoon.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Joining bug????
Date: Tue, 27 Oct 1998 11:24:58 -0500
Message-ID: <3635F3DA.F84CA6DB@insightdist.com> (raw)
References: <199810270339.DAA95886@out5.ibm.net>



pierre wrote:

> I've been attempting to get my DB tuned to handle joins as best as
> possible. However, no matter which way I try to perform the joins, if I
> attempt to join more than two or three tables the joins becomes
> unbearably long not matter how many indexes I create in however many ways.
>
> My only solution was to create a hybrid table that contains the join of
> all of the tables I'm searching on with multi-keyed indexes. This is a
> VERY kludgy solution that makes changing the keys to my DB hard to change.
>
> IS there a problem with postgresql in performing joins? Is there a fix?
> What gives?

There are many reasons for a query to take more time than expected.
PostgreSQL can do reasonably well joining many tables.   It is impossible for
anyone to even guess without more specifics.

Try submitting the specific query and the result of an EXPLAIN.
Example:
   EXPLAIN SELECT foo FROM bar;

Table sizes, indices, and time elapsed are also helpful.

BTW, in case you don't know, the "VACUUM ANALYZE" statement need to be run
occasionally to facilitate the query planner.





view thread (16+ messages)  latest in thread

Message-ID: <3635F3DA.F84CA6DB@insightdist.com>
Permalink:  ../3635F3DA.F84CA6DB@insightdist.com/
Also on:    postgresql.org/message-id/3635F3DA.F84CA6DB@insightdist.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: daveh@insightdist.com, pierre@desertmoon.com
  Subject: Re: [SQL] Joining bug????
  In-Reply-To: <3635F3DA.F84CA6DB@insightdist.com>
  References: <199810270339.DAA95886@out5.ibm.net> <3635F3DA.F84CA6DB@insightdist.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