Re: Sorting. When?

From: "mac_man2008(at)yahoo(dot)it" <mac_man2008(at)yahoo(dot)it>
To: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Sorting. When?
Date: 2011-02-11 12:50:53
Message-ID: 4D5530AD.7020801@yahoo.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yahoo(dot)it<mac_man2008(at)yahoo(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2011-02-11 13:17:24 Re: spam (http://wiki.openssi.org/go/PostgreSQL_on_OpenSSI_enabled_Knoppix)
Previous Message Robert Haas 2011-02-11 12:49:58 Re: spam (http://wiki.openssi.org/go/PostgreSQL_on_OpenSSI_enabled_Knoppix)