Article View: comp.databases.ms-sqlserver
Article #57Need a guru's help with optimization
From: Brent Eubanks
Date: Thu, 06 Mar 1997 00:00
Date: Thu, 06 Mar 1997 00:00
40 lines
1672 bytes
1672 bytes
Oh great guru! This humble one begs you to enlighten him with your wisdom on the matter of optimizing SQL scripts. 1) When doing a select/where/groupby or select/where/orderby, am I correct in assuming that the limitting operation (the where clause) is imposed before the order or group operation? IE: When working with a _very_ large table, is there any reason to separate the operation into a select/into#temp/where followed by a select/from#temp/groupby, in order to avoid applying the orderby or groupby to the entire orginal table? 2) I am writing a procedure that uses a series of select statements and a number of temp tables. Is it more efficient to drop each temp table as soon as I am finished with it in order to free up the cache space, or am I better off avoiding the drop operations and just letting SQL drop them automatically all at once when the procedure ends? I am running SQL Server 6.5 under NT 4.0. I would appreciate it if replies were cc'd to my email account: brent@ugcs.caltech.edu Thanks Brent -- -- Brent Eubanks brent@ugcs.caltech.edu
Technical Details
Message-ID:
<5fl214$bjp@gap.cco.caltech.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 104de1,3e0bfe05f7cf2998,start X-Google-Attributes: gid104de1,public X-Google-Thread: 11355a,3e0bfe05f7cf2998,start X-Google-Attributes: gid11355a,public From: brent@ugcs.caltech.edu (Brent Eubanks) Subject: Need a guru's help with optimization Date: 1997/03/06 Message-ID: <5fl214$bjp@gap.cco.caltech.edu> X-Deja-AN: 223391473 Organization: California Institute of Technology, Pasadena Keywords: optimization, SQL Newsgroups: comp.databases.ms-sqlserver,bit.listserv.sqlinfo