Re: Sorting. When? - Mailing list pgsql-hackers

From mac_man2008@yahoo.it
Subject Re: Sorting. When?
Date
Msg-id 4D5530AD.7020801@yahoo.it
Whole thread Raw
In response to Re: Sorting. When?  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Responses Re: Sorting. When?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
Nicolas, thanks.

Unfortunately I don't think I can get precise infos from that link. That 
"explains" how the EXPLAIN works, while I need to know, from an 
algorithmic point of view, in which cases sorting is invoked.
Actually, maybe I can spend some time in trying to perform samples 
queries and trying to deduce which operations calls the sorting module. 
But I think it is not the most effective way to do that, since that 
would mean running a bounch of queries for different values of work_mem, 
or for different size of the involved tables. Even if I try to do that, 
some cases can not be evident to my sight.

I am searching for someone telling me (how to get) a list of operations 
invoking sorting, and in which cases they do that.
Just for example:
- ORDER BY, always invokes sorting.
- DISTINCT, always invokes sorting
- Merge Join, just in case (..bla bla bla..)
- ...

Is it possible?
Any other suggestion?

Thanks for your time.
Best regards.

Fava


Il 11/02/2011 11:50, Nicolas Barbier ha scritto:
> [ Please don't top-post.<URL:http://en.wikipedia.org/wiki/Posting_style>  ]
>
> 2011/2/11 mac_man2008@yahoo.it<mac_man2008@yahoo.it>:
>
>> So, is there any precise way to discover when sorting is invoked?
> EXPLAIN shows how a query would be executed; explicit sorts should be
> mostly obvious.
> <URL:http://www.postgresql.org/docs/9.0/static/sql-explain.html>
>
> Nicolas
>



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Debian readline/libedit breakage
Next
From: Dimitri Fontaine
Date:
Subject: Re: ALTER EXTENSION UPGRADE, v3