Re: insane index scan times

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Sergei Shelukhin <realgeek(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: insane index scan times
Date: 2007-06-07 15:09:02
Message-ID: 20070607150902.GA15274@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jun 03, 2007 at 11:29:07PM -0700, Sergei Shelukhin wrote:
> I wonder what exactly makes index perform 100+ times slower than
> seqscan - I mean even if it's perfromed on the HD which it should not
> be given the index size, index and table are on the same HD and index
> is smaller and also sorted, isn't it?

Um, because if you scan the whole index you also have to scan the whole
table, and you're going to scan the table and the index in random
order, which is slower again.

An index is faster for selecting a *portion* of the table, it's
useless once you get to a significant percentage.

However, recent versions have Bitmap index scans which are a middle
ground, linear index scan, linear heap scan which has a much better
worst case. So perhaps you're running a really old version of postgres,
you didn't actually say what version you were running.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ABHANG RANE 2007-06-07 15:27:05 cube for real[]
Previous Message Josh Berkus 2007-06-07 14:28:05 Re: [GENERAL] Looking for Graphical people for PostgreSQL tradeshow signage