From: Paul Thomas <paul@tmsl.demon.co.uk>
To: Fabian Kreitner <fabian.kreitner@ainea-ag.de>
Cc: pgsql-performance @ postgresql . org <pgsql-performance@postgresql.org>
Subject: Re: index / sequential scan problem
Date: Thu, 17 Jul 2003 11:12:48 +0100
Message-ID: <20030717111248.C27264@bacon> (raw)
In-Reply-To: <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245>
References: <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245>
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 |
+------------------------------+---------------------------------------------+
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: paul@tmsl.demon.co.uk, fabian.kreitner@ainea-ag.de
Subject: Re: index / sequential scan problem
In-Reply-To: <20030717111248.C27264@bacon>
References: <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245> <20030717111248.C27264@bacon>
* 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