Re: Seq scan on 10million record table.. why?

From: Gabriele Bartolini <Gabriele(dot)Bartolini(at)2ndQuadrant(dot)it>
To: Vincenzo Melandri <vmelandri(at)imolinfo(dot)it>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Seq scan on 10million record table.. why?
Date: 2012-10-30 13:45:11
Message-ID: 16c001fcdb181afa554d4e60825e7c35@2ndquadrant.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Vincenzo,

On Tue, 30 Oct 2012 13:15:10 +0100, Vincenzo Melandri
<vmelandri(at)imolinfo(dot)it> wrote:
> I have indexes on both the key on the big table and the import_id on
> the sequence table.

Forgive my quick answer, but it might be that the data you are
retrieving is scattered throughout the whole table, and the index scan
does not kick in (as it is more expensive to perform lots of random
fetches rather than a single scan).

To be able to help you though, I'd need to deeply look at the ETL
process - I am afraid you need to use a different approach, involving
either queues or partitioning.

Sorry for not being able to help you more in this case.

Cheers,
Gabriele
--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
Gabriele(dot)Bartolini(at)2ndQuadrant(dot)it - www.2ndQuadrant.it

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Shaun Thomas 2012-10-30 13:53:00 Re: Seq scan on 10million record table.. why?
Previous Message ktm@rice.edu 2012-10-30 13:41:24 Re: Replaying 48 WAL files takes 80 minutes