Optimizing querries to avoid timeouts

  • I read somewhere recently on the web that you could optimize a querry. I was wondering if any out there could help me out on this for I cannot find where I read this. There was something about parameters that could be added to not load the whole table(s) in cache while querrying.

  • Generally speaking, the WHERE clause of the SELECT statement limits the number of records the query will return. As with most any client side application, you want to query for the minimum number of records required to get the job done. The WHERE clause may go a long way to helping you here. Also limit the columns in the query to what is needed, not just SELECT * ....

    If on the otherhand you want to get just a portion of total result set, then the next portion... and so on, your talking about Client to Server "scrollable" cursors, or something like that. Perhaps someone else can provide details on this for you, I've been dealing with "disconnected" resord sets lately, and that is not a "scrollable" option.

     



    Once you understand the BITs, all the pieces come together

  • Hi there

    Well, this is a somewhat complex topic, I would take an initial view at:

    http://www.sql-server-performance.com

    then try and post specific examples that you need more info on as to why its better to do XYZ over ABC.  I think you will get a lot of value from this initial look.

    Cheers

    Ck


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply