Re: index / sequential scan problem

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Fabian Kreitner <fabian(dot)kreitner(at)ainea-ag(dot)de>
Cc: "pgsql-performance (at) postgresql (dot) org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: index / sequential scan problem
Date: 2003-07-17 10:12:48
Message-ID: 20030717111248.C27264@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On 17/07/2003 10:01 Fabian Kreitner wrote:

Hi Fabian,

When you are doing these kinds of tests, you need to be aware that the
kernel may have most of your data cached after the first query and this
may be why the second query appears to run faster.

Also don't be worried if the planner chooses a seq scan for small tables
as the whole table can often be bought into memory with one IO whereas
reading the index then the table would be 2 IOs.
HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vincent van Leeuwen 2003-07-17 10:14:16 Re: Hardware performance
Previous Message Shridhar Daithankar 2003-07-17 09:17:46 Re: index / sequential scan problem