![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to test and tune two functions that retrieve records from a property database (housing characteristics & transactions). One returns information about a subject property, the other about properties near the subject. They both return tables, with identical structures. The first will (usually) return a small number of records (one or a few), and the second returns a number specified by one of the parameters, usually a few hundred. The records returned are assembled from various places in the database, and I won't trouble you with details of all the joins and conditions. Free-standing, the Subject function takes a small fraction of a second, the Nearby function takes a few seconds (2-10). In order to reduce that time, I run it in a test harness SP to get information on what sorts of cases take long and short times. When running in the test harness, the functions take about 10 times as long as when calling them on their own from Query Analyzer. If the calls come from a C++ program making ODBC calls one at a time, the calls are quick. Help -- it's more flexible to use an SP, and I would rather not write the test harness in C++ (although it wouldn't be terribly difficult), because it already exists in SQL. Another factor is that occasionally the functions run fast in the test harness -- but rarely. |
#3
| |||
| |||
|
|
Free-standing, the Subject function takes a small fraction of a second, the Nearby function takes a few seconds (2-10). In order to reduce that time, I run it in a test harness SP to get information on what sorts of cases take long and short times. When running in the test harness, the functions take about 10 times as long as when calling them on their own from Query Analyzer. If the calls come from a C++ program making ODBC calls one at a time, the calls are quick. Help -- it's more flexible to use an SP, and I would rather not write the test harness in C++ (although it wouldn't be terribly difficult), because it already exists in SQL. Another factor is that occasionally the functions run fast in the test harness -- but rarely. |
![]() |
| Thread Tools | |
| Display Modes | |
| |