From: Jesper Krogh <jesper@krogh.cc>
To: pgsql-performance@postgresql.org
Subject: Re: seq scan in the case of max() on the primary key column
Date: Thu, 16 Jun 2011 19:03:05 +0200
Message-ID: <4DFA3749.3000306@krogh.cc> (raw)
In-Reply-To: <BANLkTikntdSrhneCPzPutY9T-sAQpFXTMw@mail.gmail.com>
References: <BANLkTikntdSrhneCPzPutY9T-sAQpFXTMw@mail.gmail.com>
On 2011-06-16 15:55, Svetlin Manavski wrote:
> Hi everybody,
>
> I am running PostgreSQL 9.0 which performs well in most of the cases. I
> would skip all the parameters if these are not necessary.
>
> I need to frequently (every min) get the max value of the primary key column
> on some tables, like this case which works perfectly well:
>
> explain analyze select max(id) from appqosdata.tcpsessions;
Typically this is due to "batch load" and failing to run "analyze"
manually afterwards.. is this the case?
--
Jesper
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: jesper@krogh.cc
Subject: Re: seq scan in the case of max() on the primary key column
In-Reply-To: <4DFA3749.3000306@krogh.cc>
* 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