[geeks] SQL Performance

Lionel Peterson lionel4287 at verizon.net
Tue Jul 22 20:54:04 CDT 2008


>From: Sridhar Ayengar <ploopster at gmail.com>
>Date: 2008/07/21 Mon PM 03:13:51 EDT
>To: The Geeks List <geeks at sunhelp.org>
>Subject: [geeks] SQL Performance

>Does anyone know of any papers or web pages containing performance 
>comparisons between accessing data with many small SQL queries versus 
>accessing the same data with larger aggregate queries?
>
>I would expect the smaller number of large queries to perform better, 
>but I have no frame of reference for being able to estimate how much of 
>a difference it would make.

Sorry, when I trained in DB2, the official party line was, code for the best application design, and let the optimiser worry about performance. The idea was back then (DB 2.2-era), the optmiser was evolving and trying to guess how it worked to tweak performance was a fools errand. I assume the times have changed, but that is what i was taught, and I haven't learned a new way of working...

Sorry, back to why I originally hit reply - are you sure the DB won't turn a string of small queries into one big query (if it will run faster)? Of course, you could code to allow that to happen, or code to prevent it, but that is beyond my exp.

Lionel



More information about the geeks mailing list