Re: Left joining against two empty tables makes a query

From: Chris Travers <chris(at)travelamericas(dot)com>
To: Gnanavel S <s(dot)gnanavel(at)gmail(dot)com>
Cc: Chris Travers <chris(at)travelamericas(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Left joining against two empty tables makes a query
Date: 2005-07-29 05:23:15
Message-ID: 42E9BD43.6060203@travelamericas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


>
> Secondly, the project table has *never* had anything in it. So where
> are these numbers coming from?
>
>
> pg_statistics

I very much doubt that. I was unable to locate any rows in pg_statistic
where the pg_class.oid for either table matched any row's starelid.

Tom's argument that this is behavior by design makes sense. I assumed
that something like that had to be going on, otherwise there would be
nowhere for the numbers to come from. I.e. if there never were any rows
in the table, then if pg_statistic is showing 1060 rows, we have bigger
problems than a bad query plan. I hope however that eventually tables
which are truly empty can be treated intelligently sometime in the
future in Left Joins. Otherwise this limits the usefulness of out of
the box solutions which may have functionality that we don't use. Such
solutions can then kill the database performance quite easily.

Chris Travers
Metatron Technology Consulting

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew McMillan 2005-07-29 05:50:11 Re: Performance problems testing with Spamassassin 3.1.0
Previous Message Matthew Schumacher 2005-07-29 05:10:07 Re: Performance problems testing with Spamassassin 3.1.0