From: | AI Rumman <rummandba(at)gmail(dot)com> |
---|---|
To: | Kevin Grittner <kgrittn(at)mail(dot)com> |
Cc: | Claudio Freire <klaussfreire(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Evgeny Shishkin <itparanoia(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, postgres performance list <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: Why does the number of rows are different in actual and estimated. |
Date: | 2012-12-14 22:12:39 |
Message-ID: | CAGoODpdTtFfP5bq+DaHOzSkJ6tTteGVeKoRFe+suaOrGbKvLxg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Fri, Dec 14, 2012 at 3:34 PM, Kevin Grittner <kgrittn(at)mail(dot)com> wrote:
> 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
>
The ENTITY table has 2164493 rows with data as follows:
type | count
-----------------------+--------
Contacts | 327352
Candidate | 34668
Emailst | 33604
Calendar | 493956
Contacts Image | 7
PriceBooks | 2
Notes Attachment | 17
SalesOrder | 6
Acc | 306832
...
..
(29 rows)
Do you think partitioning will improve the overall performance of the
application where all the queries have join with this table?
From | Date | Subject | |
---|---|---|---|
Next Message | Kevin Grittner | 2012-12-14 22:47:39 | Re: Why does the number of rows are different in actual and estimated. |
Previous Message | Kevin Grittner | 2012-12-14 20:34:03 | Re: Why does the number of rows are different in actual and estimated. |