pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@mail.com>
To: Claudio Freire <klaussfreire@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: AI Rumman <rummandba@gmail.com>
Cc: Evgeny Shishkin <itparanoia@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Why does the number of rows are different in actual and estimated.
Date: Fri, 14 Dec 2012 15:34:03 -0500
Message-ID: <20121214203403.80070@gmx.com> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Claudio Freire wrote:

> Selectivity is decided based on the number of distinct values on
> both sides, and the table's name "entity" makes me think it's a
> table that is reused for several things. That could be a problem,
> since that inflates distinct values, feeding misinformation to
> the planner.
> 
> Rather than a generic "entity" table, perhaps it would be best to
> separate them different entities into different tables.

I missed that; good catch. Good advice.

Don't try to build a "database within a database" by having one
table for different types of data, with a code to sort them out.
EAV is a seriously bad approach for every situation where I've seen
someone try to use it. I was about to say it's like trying to drive
a nail with a pipe wrench, then realized it's more like putting a
bunch of hammers in a bag and swinging the bag at the nail.

-Kevin


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (20+ messages)  latest in thread

Message-ID: <20121214203403.80070@gmx.com>
Permalink:  ../20121214203403.80070@gmx.com/
Also on:    postgresql.org/message-id/20121214203403.80070@gmx.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: kgrittn@mail.com, klaussfreire@gmail.com, tgl@sss.pgh.pa.us, rummandba@gmail.com, itparanoia@gmail.com, andrew@dunslane.net
  Subject: Re: Why does the number of rows are different in actual and estimated.
  In-Reply-To: <20121214203403.80070@gmx.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