List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:July 12 2002 1:37pm
Subject:Re: SELECT performance
View as plain text  
What would you expect?
You ask for the whole file, and then ask
that it be sorted by two fields.
How do you expect this to happen without  a temp file?

Tiago Antao wrote:

> Hi!
> I have a very simple query
> SELECT a, b FROM t ORDER BY a, b
> I also have an index on t(a)
> I have run ANALYZE
> Also the number of repetitions of values of a in t is very low.
> My view is that the execution should require little temporary space 
> and little time, something like:
> for each different a(already ordered and of fast access from index) {
>   get all rows (usually 3/4, max arround 300)
>   sort this (little) subset
> }
> What is happening is that a tmp file of the size of the t is being 
> generated.
> Is there any thing that I am not seeing? I there any way to change 
> this behaviour?
> Thanks,
> Tiago

SELECT performanceTiago Antao12 Jul
  • Re: SELECT performanceGerald Clark12 Jul