Re: ADP vs QA Queries
- From: "Ruggiero Lauria" <ruggiero.lauria@xxxxxxxxxxx>
- Date: Thu, 24 Apr 2008 18:12:08 +0200
We reindex once a week and update statistics every night, my be could
reindex some more, but the question is how is possible some query runs so
different in Access and QA enviroment, at the same time?
I suppose they should use the some query plan, or not?
Thanks again
Ruggiero Lauria
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> ha
scritto nel messaggio news:%23keujPipIHA.3568@xxxxxxxxxxxxxxxxxxxxxxx
The most likely explanation is a use of bad query plans because the
statistics are out of date or the first times the SP are called - and
compiled -, they are with atypical parameters. The first step would be to
update the statistics using the sp_updatestats stored procedure (or use
UPDATE STATISTICS is you want to work on a more detailed level) and clean
the caches after that:
DBCC FLUSHPROCINDB
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
After that, if you still have problems, you can think about reindexing
and - very important -, you can
take some precautions about the use of atypical parameters and
recompilations in order to eliminate the reuse of bad query plans. See:
http://sqlknowledge.com/index.php?op...d=65&Itemid=41
Reindexing:
http://blog.sqlauthority.com/2007/01...ics-on-tables/
Good article on the use of the With Recompile option and of intermediary
variables in order to deactivate the parameters sniffing from SQL-Server
(the use of intermediary variables is probably better than to use the With
Recompile option because recompiling big procedures take time):
http://blogs.msdn.com/khen1234/archi...02/424228.aspx . (It's useless to
use both technics at the same time).
If you are with SQL-Server 2005, you can also play with the OPTIMIZE FOR
option instead of deactivating the parameters sniffing or using the With
Recompile option; see:
http://www.sql-server-performance.co...guides_p1.aspx
and: http://www.sql-server-performance.co..._hints_p1.aspx
Finally, here's a good reference on recompilation:
http://www.microsoft.com/technet/pro...05/recomp.mspx
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Ruggiero Lauria" <ruggiero.lauria@xxxxxxxxxxx> wrote in message
news:uXKNUFipIHA.4672@xxxxxxxxxxxxxxxxxxxxxxx
I have really a strange issue.
Same Query "select......" runned via ADP goes in timeout, from profiler
i saw it took about 30000 ms, runned under Query Analyzer took 300 ms!
Any Idea, I have a serious performace issue.
thanks
Ruggiero Lauria
.
- Follow-Ups:
- Re: ADP vs QA Queries
- From: Sylvain Lafontaine
- Re: ADP vs QA Queries
- References:
- ADP vs QA Queries
- From: Ruggiero Lauria
- Re: ADP vs QA Queries
- From: Sylvain Lafontaine
- ADP vs QA Queries
- Prev by Date: Converting report to rft in Vista/2007 takes much longer than XP/2003
- Next by Date: Re: MSSQL Restore Error: The system database cannot be moved by RESTORE
- Previous by thread: Re: ADP vs QA Queries
- Next by thread: Re: ADP vs QA Queries
- Index(es):
Relevant Pages
|