Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

Next:From: Andrew McMillanDate: 2005-07-29 05:50:11
Subject: Re: Performance problems testing with Spamassassin 3.1.0
Previous:From: Matthew SchumacherDate: 2005-07-29 05:10:07
Subject: Re: Performance problems testing with Spamassassin 3.1.0

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group