Re: Scaling 10 million records in PostgreSQL table

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Scaling 10 million records in PostgreSQL table
Date: 2012-10-08 19:53:48
Message-ID: 0465ecd0abdd8c64e254b08ae327f566@webmail.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2012-10-08 10:26, Navaneethan R wrote:
> Hi all,
>
> I have 10 million records in my postgres table.I am running the
> database in amazon ec2 medium instance. I need to access the last
> week
> data from the table.
> It takes huge time to process the simple query.So, i throws time out
> exception error.
>
> query is :
> select count(*) from dealer_vehicle_details where modified_on
> between '2012-10-01' and '2012-10-08' and dealer_id=270001;
>
> After a lot of time it responds 1184 as count
>
> what are the ways i have to follow to increase the performance of
> this query?
>
> The insertion also going parallel since the daily realtime updation.
>
> what could be the reason exactly for this lacking performace?
What indexes do you have on your table?

I'll bet none.

What does an explain select count(*) from dealer_vehicle_details where
modified_on
between '2012-10-01' and '2012-10-08' and dealer_id=270001;

show?

I have a 380Million row table, with LOTS of indexing, and we perform
very well.

Without indexes, the query had to sequential scan all 10 million rows.
That's going to be bad on ANY database.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Crawford 2012-10-08 20:09:59 Re: Scaling 10 million records in PostgreSQL table
Previous Message Julien Cigar 2012-10-08 19:52:29 Re: Scaling 10 million records in PostgreSQL table