You are here: Severe performance hit with NCHAR queries « MsSQL Server « IT news, forums, messages
Severe performance hit with NCHAR queries

Posted by Daniel Smedegaard Buus on 11/22/06 10:50

Hey there :)

Sorry if I'm asking a dumb question here, but I'm still quite new to MS SQL,
so this problem might appear larger to me than it really is.

I'm trying to create a performance test environment for a Ruby on Rails and
Mongrel setup with an MS SQL Server 2000.

The adapter, mssqlclient, uses some kind of "conversion" for unicode, here's
a quote from the homepage:

"Automatically translate from proper UTF-16LE nvarchar fields in the
database to UTF-8 Ruby Strings you can display in your application"

As far as the local DB designer knows, we're not using UTF16-LE nvarchar
fields, unless it's something that happens implicitly.

Either way, this is how a query from the mssqlclient adapter might look:

SELECT TOP 1 * FROM Item WHERE (Item.Itemnumber = N'45783745')

Response time the first couple of times was upwards of 20+ seconds, after
the sql server has "awaken from its slumber", it's roughly 4 seconds.

Omitting the "N" from the WHERE clause, response time is in milliseconds (as
one would expect, regardless of the fact that there's currently >2.5
million items in the table).

Any tips on how to resolve this? Is the SQL statement bad, or is it a
question of configuring SQL Server correctly?

Thanks in advance for any help,
Daniel Buus :)

--
http://www.rhesusb.dk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация