Re: Why no performance boost although I added an index?

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Holger Marzen <holger(at)marzen(dot)de>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why no performance boost although I added an index?
Date: 2003-04-07 22:05:43
Message-ID: Pine.GSU.4.44.0304071505190.5024-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> If the index scan is reading a large enough percentage of the rows (and
> depending on the clustering of values), it may be reading enough pages
> that there's no advantage (or even a disadvantage) to using the index.
> This is due to both the reads of the index itself and the fact that it'll
> often be reading the values in the main table (it still needs to get the
> commit info from the table data) in random order rather than sequential
> order which can lose some optimizations the OS often gives to sequential
> reads.

This is a really big lose if your index and table are on the same disk.

Jon

>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-04-07 22:12:07 Re: vacuum by non-owner
Previous Message Stephan Szabo 2003-04-07 21:31:29 Re: Why no performance boost although I added an index?