[HACKERS] Optimizer sorting an already sorted result

2008-04-29 Thread Gurjeet Singh
In the plan below, we can see that the optimizer is sorting an already sorted result. It seems to forget the sort order across the UNIQUE node. My question is, do we make any attempts in the optimizer to remember the sort order of a result, to avoid any further sorting on same sort-key? If not,

Re: [HACKERS] Optimizer sorting an already sorted result

2008-04-29 Thread Tom Lane
Gurjeet Singh [EMAIL PROTECTED] writes: In the plan below, we can see that the optimizer is sorting an already sorted result. It seems to forget the sort order across the UNIQUE node. My question is, do we make any attempts in the optimizer to remember the sort order of a result, to avoid any