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

Why is the query not using the index for sorting?

From: Jonathan Blitz <jblitz(at)013(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Why is the query not using the index for sorting?
Date: 2009-11-22 12:50:51
Message-ID: 6913EA33EE934FF3B17ADA8A87082D15@jblaptop (view raw or flat)
Thread:
Lists: pgsql-performance
I have a table with a number of columns.
 
I perform 
 
Select * 
from table
order by a,b
 
There is an index on a,b which is clustered (as well as indexes on a and b
alone).
I have issued the cluster and anyalze commands.
 
Nevertheless, PostgreSQL performs a Sequential Scan on the table and then
performs a sort.

Am I missing something?
 
Jonathan Blitz

Responses

pgsql-performance by date

Next:From: Thom BrownDate: 2009-11-22 13:10:26
Subject: Re: Why is the query not using the index for sorting?
Previous:From: afancyDate: 2009-11-22 09:02:20
Subject: Re: Performance degrade running on multicore computer

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