Re: Why is sorting on two columns so slower thansortingon one column?
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Why is sorting on two columns so slower thansortingon one column? |
| Дата | |
| Msg-id | 23613.1293118017@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Why is sorting on two columns so slower thansortingon one column? (Kenneth Marshall <ktm@rice.edu>) |
| Ответы |
Re: Why is sorting on two columns so slower thansortingon
one column?
|
| Список | pgsql-hackers |
Kenneth Marshall <ktm@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
sizeis 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
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера