Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Expect the Unexpected slowdown in SQL Server
Message
De
01/03/2007 08:36:09
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Expect the Unexpected slowdown in SQL Server
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01199929
Message ID:
01199929
Vues:
82
I have a program written in VFP 9 which uses Sql Pass Through to Sql Server 2000. It is creating an "inventory" reference table of all our web artwork. Since there are 1.5 million files involved and we expect the number to grow considerably we choose to use SQL Server as the repository.

When I started the application it was inserting records at 500 per second, now with 300,000 records it is slowed to 5 per second. The VFP app is taking negligable CPU time so I can only assume that SQL Server is dragging it's butt.

The code first attempts an UPDATE which is structured to raise and error on the Server if the record is not found, and when the error occurs VFP program will execute an INSERT statement. The where clause of the update statement uses an index which is not the primary key.

The code is as follows:
		Set Textmerge On To Memvar lcSql Noshow
			\\update coverart set
			\\ isbn10 = '<<TRIM(lcIsbn)>>',
			\\ isbn13 = '<<TRIM(lcIsbn13)>>',
		If Not Empty(lcJFilename)
				\\JFilename = '<<lcJfilename+lcfilename>>'
		Else
				\\JFilename = '<<lcJfilename+lcfilename>>'
		Endif
			\ where isbn13 = '<<TRIM(lcIsbn13)>>'
			\IF @@ROWCOUNT = 0
			\RAISERROR ('No Column was Updated/Deleted', 16, 1)
		Set Textmerge To

		If SQLExec(This.nSql,lcSql) < 0 
			Set Textmerge On To Memvar lcSql Noshow
				\\insert into coverart (isbn10,isbn13,jfilename,tFilename) values (
				\\ '<<TRIM(lcIsbn)>>','<<TRIM(lcIsbn13)>>',
			If Not Empty(lcJFilename)
					\\'<<lcJfilename+lcfilename>>',''
			Else
					\\'','<<lcTfilename+lcfilename>>'
			Endif
				\\ )
			Set Textmerge To
			lnOk = SQLExec(This.nSql,lcSql)
		Endif
Is it typical that the SQL Server would experience such a slowdown upon heavy loading such as this?

Thanks

Glenn
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform