Re: sort performance better with little memory than big memory

2022-12-03 Thread David Rowley
On Sun, 4 Dec 2022 at 00:14, yang zhao wrote: > So,can we try to split memory to pieces and qsort every one,and merge than > all in memory,I have tried this in my local code, and got about 12% > improvement when memory is enough. We're not very good at CPU cache awareness. The hard part here w

sort performance better with little memory than big memory

2022-12-03 Thread yang zhao
hello, I am running some sorting sql on my machine,test data is tpch100g, and sql is:explain analyze verbose select l_shipdate,l_orderkey from lineitem_0 order by l_shipdate,l_orderkey desc . I found that when I set work_mem to 65MB,sort method is external merge with disk,which cost 50s in my serv