Skip site navigation (1) Skip section navigation (2)

Re: seq scan in the case of max() on the primary key column

From: Jesper Krogh <jesper(at)krogh(dot)cc>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: seq scan in the case of max() on the primary key column
Date: 2011-06-16 17:03:05
Message-ID: 4DFA3749.3000306@krogh.cc (view raw or flat)
Thread:
Lists: pgsql-performance
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

In response to

pgsql-performance by date

Next:From: Magnus HaganderDate: 2011-06-16 17:25:56
Subject: Re: seq scan in the case of max() on the primary key column
Previous:From: HaestanDate: 2011-06-16 15:09:54
Subject: Performance advice for a new low(er)-power server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group