Re: Why does the number of rows are different in actual and estimated.

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "AI Rumman" <rummandba(at)gmail(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:47:39
Message-ID: 20121214224739.80090@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

AI Rumman wrote:

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

I would not consider putting contacts, calendars, and sales orders
in separate tables as "partitioning". It is normalizing. That will
be useful if you happen to discover, for instance, that the data
elements needed or relationships to other types of data for a
calendar don't exactly match those for a contact image or a sales
order.

And yes, I would expect that using separate tables for
fundamentally different types of data would improve performance. If
some of these objects (like contacts and candidates) have common
elements, you might want to either have both inherit from a common
Person table, or (usually better, IMO) have both reference rows in
a Person table. The latter is especially important if a contact can
be a candidate and you want to be able to associate them.

-Kevin

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2012-12-15 00:22:14 Re: Do I have a hardware or a software problem?
Previous Message AI Rumman 2012-12-14 22:12:39 Re: Why does the number of rows are different in actual and estimated.