Re: Seq Scan vs Index on Identical Tables in Two Different Databases

From: Ellen Rothman <erothman(at)datalinedata(dot)com>
To: bricklen <bricklen(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Seq Scan vs Index on Identical Tables in Two Different Databases
Date: 2013-07-17 21:54:03
Message-ID: 91532d88b5704d2994188a8b82936828@BL2PR08MB164.namprd08.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I guess not. I usually vacuum with the analyze option box checked; I must have missed that this cycle.

It looks much better now.

Thanks!

From: bricklen [mailto:bricklen(at)gmail(dot)com]
Sent: Wednesday, July 17, 2013 4:12 PM
To: Ellen Rothman
Cc: pgsql-performance(at)postgresql(dot)org<mailto:pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORM] Seq Scan vs Index on Identical Tables in Two Different Databases

On Wed, Jul 17, 2013 at 12:50 PM, Ellen Rothman <erothman(at)datalinedata(dot)com<mailto:erothman(at)datalinedata(dot)com>> wrote:
I have the same table definition in two different databases on the same computer. When I explain a simple query in both of them, one database uses a sequence scan and the other uses an index scan. If I try to run the Seq Scan version without the where clause restricting the value of uniqueid, it uses all of the memory on my computer and never completes.

How can I get the Seq Scan version to use an index scan?

Did you run "ANALYZE your-table-name" before trying the sequential scan query?
________________________________
No virus found in this message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 2013.0.3349 / Virus Database: 3204/6483 - Release Date: 07/11/13

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2013-07-17 22:46:23 bgwriter autotuning might be unnecessarily penalizing bursty workloads
Previous Message David Kerr 2013-07-17 21:40:00 Re: Seq Scan vs Index on Identical Tables in Two Different Databases