rashroush عضو برونزي
عدد الرسائل : 1907 العمر : 101 المـــــزاج : هوايــــتي : النـشــــاط : الفــــريـق : الأوســــمة : تاريخ التسجيل : 15/05/2008
| موضوع: help السبت أكتوبر 18, 2008 10:20 am | |
| Hey Guys, I have an asp.net application that is connected to SQL server DB. And I am doing a "serach" inside a table called "memories", basically, my search is being performed in a nvarchar columns(3 cloumns). number of rows is approximatly, (100000) rows.(100k) Here is the query: SELECT * FROM (select top 25 * from (SELECT top $Pg$ * FROM Memories WHERE (Title LIKE '%'+ #key# + '%' OR Description LIKE '%'+ #key# + '%' OR Occasion LIKE '%'+ #key# + '%' AND Active=1) )as v1 order by v1.CreateDate Asc) Anyway, my question is, when i run this query from sql server, it get executed in 1 minute and 9 seconds. of course, it is timing out in my web application. Anybody have a clue, how i can rewrite this query, to make it faster?? Some details: -This query is used with paged repeater-$pg$ = (25*page number), where 25 is the number of records per page -title: most memories will ahve approximatly 50 character for title -description: this is like a story, it will be around 5000 charcter /memory -occasion, like title-typically short. please see screenshot, from quer analyzer. Anyhelp is greatly appreciated.
|
| |
|
~žô§ž(AbuKishik .
عدد الرسائل : 9041 العمر : 37 التخصص : A.I.S المـــــزاج : هوايــــتي : النـشــــاط : الفــــريـق : الأوســــمة :
[table style=\"BORDER-RIGHT: #000000 1px dashed; BORDER-TOP: #000000 1px dashed; BORDER-LEFT: #000000 1px dashed; BORDER-BOTTOM: #000000 1px dashed\" width=\"10%\" border=0][tr][td]
[center]
[/td][/tr][/table][/center] تاريخ التسجيل : 30/10/2007
| موضوع: رد: help الإثنين أكتوبر 27, 2008 4:07 pm | |
| | |
|