Results 1 to 3 of 3

Thread: SQL Tuning

  1. #1
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1

    Unanswered: SQL Tuning

    I'm reading the book "SQL Tuning" by Dan Tow (ISBN 0-596-00573-3).
    It states the following "Query performance is almost entirely determined by which rows in the database you touch and how you reach them. What you do with those rows, which columns you return, and which expressions you calculate are almost irrelevant to performance".

    ORDER BY, GROUP BY, & HAVING operations are almost never important to query performance.

    This book describes a detailed scientific methodology for optimizing SQL
    for Oracle, SQL Server & DB2 databases!

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    strange since ORDER_BY, GROUP_BY and HAVING all add to the cost of the operation.
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >strange since ORDER_BY, GROUP_BY and HAVING all add to the cost of the operation.
    Dan Tow acknowledges that all three do "add cost" (time) to produce the desired results. However he claims that his real world measurements reveal that almost without exception the time these operations consume are typically dwarfed by the time needed to acquire the desired rows. For the majority of well tuned production DB systems
    all three of these operations are done in memory after all the rows have been retrieved. Yes, I will conceed that for LARGE resultsets the sort could be forced to disk, but again consider the costs involved with getting the LARGE resultset in the first place.

    Produce a sample real world SQL with SQL_TRACE enabled
    with both an ORDER BY & no ORDER clause and demonstrate
    how much the actual cost of the ORDER BY really is.
    The proof is the the pudding; as the saying goes.
    From my limited testing, I agree with the author.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •