This is not a hibernate query per say, just a general SQL question, but since everyone here is dealing with SQL, I thought I'd ask it to you guys. I have 2 questions :
We cant pass in parameters to ORDER BY or GROUP BY in JDBC PreparedStatements. This leads me to believe that the SQL Compiler cannot do dynamic ordering or aggregation. Why is this ? Why cant a SQL compiler sort or aggregate dynamically ?
From what I read, the sql compiler does the sort AFTER getting the results. It does this in memory buffers, or if the buffer size is small, it spills into temp tables. What, if any, are the performance hits of doing this on the server side ?
thanks in advance...
S
|