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

Re: Query performance on session table

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Burak Seydioglu" <buraks78(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Query performance on session table
Date: 2007-06-29 03:49:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Jun 28, 2007, at 22:28 , Burak Seydioglu wrote:

> This query is really fast as you can see in my original post.

Ah. I should have referred to your original email.

> The garbage collector (DELETE FROM session WHERE session_expires <
> timestamp) has to do the same sequential scan.

You may find benefit from putting an index on the session_expires  
column, though of course to maintain the index with a lot of updates,  
you may see update performance degrade because the update requires  
the index to be updated as well. The only way to find out is by  
benchmarking your app and see what happens. With such a small number  
of rows, the planner may determine that a sequential scan is still  
faster than an index scan, so you'd end up with the same performance  
on DELETE that you have now.

> Thank you for you input.

Well, we're both learning together :)

Michael Glaesemann
grzm seespotcode net

In response to

pgsql-novice by date

Next:From: Dale CooperDate: 2007-07-01 21:19:15
Subject: A few comparison terms just to be sure.
Previous:From: Burak SeydiogluDate: 2007-06-29 03:28:05
Subject: Re: Query performance on session table

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