Recompiling Stored Procs
From: Rob Poyntz (rpoyntz_at_vaneyk.com)
Date: 02/28/05
- Next message: Timothy: "Master and detail question"
- Previous message: Bill Hicks: "Sample for Creating ADO dataset in code..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Feb 2005 15:10:41 +1100
Hi all,
Have coded a stored proc in SQLServer2K which runs fine in Query Analyser,
taking approx 0.5 seconds to run. However, when calling the stored proc from
my Delphi app, it takes approx three seconds. Further investigation using
Performance Monitor (looking at SQL:General statistics / SQL Compilations
per second), it seems that the running from Delphi causes the stored proc to
be recompiled each time, whilst from Query Analyser it compiles once (if
needed), then uses the stored execution plan from the cache, as would be
expected.
Does anyone know why recompilation is caused by calling the stored proc from
Delphi each time, and how I can prevent it?
Many thanks in advance,
Rob
rpoyntz@vaneyk.com.au
- Next message: Timothy: "Master and detail question"
- Previous message: Bill Hicks: "Sample for Creating ADO dataset in code..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|