Re: CUDA Sorting
Hans-Jürgen Schönig <postgres@cybertec.at>
From: PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Stark <stark@mit.edu>, Greg Smith <greg@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2011-09-19T19:41:34Z
Lists: pgsql-hackers
On Sep 19, 2011, at 5:16 PM, Tom Lane wrote: > Greg Stark <stark@mit.edu> writes: >> That said, to help in the case I described you would have to implement >> the tapesort algorithm on the GPU as well. > > I think the real problem would be that we are seldom sorting just the > key values. If you have to push the tuples through the GPU too, your > savings are going to go up in smoke pretty quickly … > i would argument along a similar line. to make GPU code fast it has to be pretty much tailored to do exactly one thing - otherwise you have no chance to get anywhere close to card-bandwith. if you look at "two similar" GPU codes which seem to do the same thing you might easily see that one is 10 times faster than the other - for bloody reason such as memory alignment, memory transaction size or whatever. this opens a bit of a problem: PostgreSQL sorting is so generic and so flexible that i would be really surprised if somebody could come up with a solution which really comes close to what the GPU can do. it would definitely be interesting to see a prototype, however. btw, there is a handful of interesting talks / lectures about GPU programming provided by the university of chicago (just cannot find the link atm). regards, hans -- Cybertec Schönig & Schönig GmbH Gröhrmühlgasse 26 A-2700 Wiener Neustadt, Austria Web: http://www.postgresql-support.de