Re: [SQL] Joining bug???? - Mailing list pgsql-sql

From David Hartwig
Subject Re: [SQL] Joining bug????
Date
Msg-id 3635F3DA.F84CA6DB@insightdist.com
Whole thread Raw
In response to Joining bug????  (pierre <pierre@desertmoon.com>)
Responses Re: [SQL] Joining bug????  (pierre@desertmoon.com)
List pgsql-sql

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.



pgsql-sql by date:

Previous
From: "Gene Selkov Jr."
Date:
Subject: Re: [SQL] Joining bug????
Next
From: pierre@desertmoon.com
Date:
Subject: Re: [SQL] Joining bug????