Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored Procedure always faster?
Message
 
 
À
26/07/2006 16:31:46
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Database:
MS SQL Server
Divers
Thread ID:
01140442
Message ID:
01140828
Vues:
20
Mike,

Actually this benchmark is more testing your network/SQL server connection speed than anything else. *s*

I'd be curious if you dropped the ? parameter from the test and tried it like this:
sqlprepare(m.gnConnHandle,"select au_id from titleauthor where titleauthor.royaltyper = " + transform( lnpercentage) )
a=seconds()
FOR m.X = 1 TO 10000
  sqlexec(m.gnConnHandle,"select au_id from titleauthor where titleauthor.royaltyper = " + transform( lnpercentage),"c_ByRoyalty")
ENDFOR m.X
m.lnElapsed = seconds() - m.a
?"Dynamic SQL",m.lnElapsed
>I was told a stored procedure is ALWAYS faster than dynamic SQL. However I've read that this is a myth.
>
>I know there has to be reasons where the SP will beat the dynamic SQL - as in cases where the SP has to do major processing where it's proximity to the data will help.
>
>However this seems to indicate a report writer that generates a dynamic SQL should beat a simple SP.
>
>I've got an ODBC connection to the pubs database called PubsODBC. SQL Server and FoxPro are on the same machine. Since both of these tests return the same data across the network, the test is valid, no?
>
>The dynamic SQL is 2 times faster than the SP. Can you guys confirm this?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform