Kenneth Marshall <k...@rice.edu> writes: > On Thu, Dec 23, 2010 at 10:42:26PM +0800, Li Jie wrote: >> But in the last query that sorts on "id", since the query selects all the >> columns for output, the actual sorted size is the same, and the only >> difference is the comparison cost. The query sorting on two columns needs to >> do twice the comparison. Am I right?
> I think you are right. Sorry for the confusion. I doubt the cost of comparing two integers is the issue here; rather it's more likely one of how many merge passes were needed. You could find out instead of just speculating by turning on trace_sort and comparing the log outputs. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers