Re: Left joining against two empty tables makes a query - Mailing list pgsql-performance

From Chris Travers
Subject Re: Left joining against two empty tables makes a query
Date
Msg-id 42E9BD43.6060203@travelamericas.com
Whole thread Raw
In response to Re: Left joining against two empty tables makes a query SLOW  (Gnanavel S <s.gnanavel@gmail.com>)
Responses Re: Left joining against two empty tables makes a query
List 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

pgsql-performance by date:

Previous
From: Matthew Schumacher
Date:
Subject: Re: Performance problems testing with Spamassassin 3.1.0
Next
From: Andrew McMillan
Date:
Subject: Re: Performance problems testing with Spamassassin 3.1.0