From: Gabriele Bartolini <Gabriele.Bartolini@2ndQuadrant.it>
To: Vincenzo Melandri <vmelandri@imolinfo.it>
Cc: pgsql-performance@postgresql.org
Subject: Re: Seq scan on 10million record table.. why?
Date: Tue, 30 Oct 2012 14:45:11 +0100
Message-ID: <16c001fcdb181afa554d4e60825e7c35@2ndquadrant.it> (raw)
In-Reply-To: <CAHSd9GfstpNZHaW+o34S2joPUL03QYoH8s_dMrhMm-f0B2REVw@mail.gmail.com>
References: <CAHSd9GfstpNZHaW+o34S2joPUL03QYoH8s_dMrhMm-f0B2REVw@mail.gmail.com>
Hi Vincenzo,
On Tue, 30 Oct 2012 13:15:10 +0100, Vincenzo Melandri
<vmelandri@imolinfo.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.Bartolini@2ndQuadrant.it - www.2ndQuadrant.it
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: Gabriele.Bartolini@2ndQuadrant.it, vmelandri@imolinfo.it
Subject: Re: Seq scan on 10million record table.. why?
In-Reply-To: <16c001fcdb181afa554d4e60825e7c35@2ndquadrant.it>
* 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