Re: [sql]Joins

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Najm Hashmi <najm(at)mondo-live(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [sql]Joins
Date: 2000-11-09 16:24:27
Message-ID: Pine.BSF.4.21.0011090821140.43216-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Fri, 10 Nov 2000, Najm Hashmi wrote:

> I am facing a dilemma at my work, I am using postgres first time. For
> some reason, my co-workers think that in Postgres joins i.e.
> simple joins of two or three tables are so bad that their cost is
> exponential. They believe that postgres simply takes Cartesian product
> of joining table in order to obtain desired tuples i.e. no optimization
> is done.
> I refused to believe so. I need your help to convince
> them that it is okay to join tables --two or three tables :)-- so we can
> eliminate redundancies from the database. I also want to know how
> postgres optimizes a join query. Thank you very much your help.

Umm, I don't know where they got that idea. Tom Lane can go into details
as the optimizer guru, but as a start, if you use EXPLAIN on your queries,
the system will tell you what plan it would use if you were to run the
query. That will get you some idea of what the system is doing.

I've had no problems really until about 8-12 tables joined when you might
tickle a bug in some versions of postgres which cause bogus plans to be
generated.

In response to

  • [sql]Joins at 2000-11-10 15:59:28 from Najm Hashmi

Responses

  • Re: [sql]Joins at 2000-11-09 18:59:48 from Cristóvão B. B. Dalla Costa

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2000-11-09 16:25:15 Re: Oracle, ODBC, MS IIS -> problem!
Previous Message Peter Eisentraut 2000-11-09 15:53:47 Re: [SQL] alter pg_shadow