pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Travers <chris@travelamericas.com>
To: Gnanavel S <s.gnanavel@gmail.com>
Cc: Chris Travers <chris@travelamericas.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Left joining against two empty tables makes a query
Date: Thu, 28 Jul 2005 22:23:15 -0700
Message-ID: <42E9BD43.6060203@travelamericas.com> (raw)
In-Reply-To: <eec3b03c050728210512f3fed5@mail.gmail.com>
References: <42E86A03.1070803@travelamericas.com>
	<eec3b03c050728025527b91961@mail.gmail.com>
	<42E90E19.3030702@travelamericas.com>
	<eec3b03c050728210512f3fed5@mail.gmail.com>


>
>     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



view thread (8+ messages)  latest in thread

Message-ID: <42E9BD43.6060203@travelamericas.com>
Permalink:  ../42E9BD43.6060203@travelamericas.com/
Also on:    postgresql.org/message-id/42E9BD43.6060203@travelamericas.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: chris@travelamericas.com, s.gnanavel@gmail.com
  Subject: Re: Left joining against two empty tables makes a query
  In-Reply-To: <42E9BD43.6060203@travelamericas.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox