Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 New, faster search.asp for SQL Server DBs
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 09 March 2003 :  11:19:26  Show Profile  Send ruirib a Yahoo! Message
For a while I've been helping people trying to work around the 40 secs timeout problem experimented on search.asp, for forums with many posts. Recently, while trying to have a consistent look on the existing indexes for the SQL Server DB I realized a different approach could be taken, in the attempt to diminish the time the search query takes to complete, when performing wide scoped searches on forums with a lot of posts.

Basically the code has been changed to implement the search over the topics and replies tables as a UNION of two different queries, instead of a single query with a LEFT JOIN. In a test forum with many posts, in my own computer (not a very fast one, and only with 384 MB of RAM for that matter), this strategy has shaved off something like 30 to 60 secs of a query that takes between 90 secs to 120 secs to complete, and that I use as a benchmark.

So, for anyone who might be interested, I'm posting the link to the search page. It is ONLY for SQL SERVER databases, since MySQL does not support UNION Queries and Access does not support UNIONS in subqueries.

The search page also has the paging feature disabled. This has been the way to avoid the annoying 40 sec timeout.

So, here is the link to the page. Just replace your current search.asp by the one included. I've tested it as much as I could, so I don't expect problems with it, but one never knows...


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 09 March 2003 16:44:38

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 09 March 2003 :  13:05:00  Show Profile
Is that the same one you emailed to me in searchNoPaging.zip ?

The UK MkIVs Forum
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 09 March 2003 :  15:46:50  Show Profile  Visit Jeepaholic's Homepage
Fantastic job, Rui. This has shaved nearly a minute off of a two-minute query on my forums. Whoohoo!
Al

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 09 March 2003 :  16:34:05  Show Profile  Visit PeeWee.Inc's Homepage
now if only we could think of a way to make it faster for access

De Priofundus Calmo Ad Te Damine
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 09 March 2003 :  16:41:22  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by DavidRhodes

Is that the same one you emailed to me in searchNoPaging.zip ?


No David, this is a new one. The SQL statement was significantly changed in this one. The previous one only had the paging code removed.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 09 March 2003 16:42:00
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 09 March 2003 :  16:43:24  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by Jeepaholic

Fantastic job, Rui. This has shaved nearly a minute off of a two-minute query on my forums. Whoohoo!
Al


Glad to know that. I had your forum in mind when I did this. It has bugged me for quite a while .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 09 March 2003 :  16:46:24  Show Profile
cheers, i'll try the new one asap, good work!

The UK MkIVs Forum
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 09 March 2003 :  16:58:29  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by PeeWee.Inc

now if only we could think of a way to make it faster for access


It's a bit difficult, since Access does not support the required SQL. With stored queries it could be doable, but it's a completely different approach than the one used in the forum.

I may try to implement it for Access one of these days.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Webguy
New Member

Australia
65 Posts

Posted - 09 March 2003 :  17:23:28  Show Profile  Send Webguy an ICQ Message
What about MYSQL, it's free text searching does suck somewhat! ;-( it's so bad I have disabled searching the archives till I either go to MS SQL or somebody suggests a better way for MY SQL.

"Special bulletin: There is still no news from New Zealand. If they ever have any, we'll be sure to let you know."
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 09 March 2003 :  17:42:41  Show Profile  Send ruirib a Yahoo! Message
Last time I looked UNION support was programmed for version 4.0 (which I don't know if it's in release status) and I think subquery support was not yet available. Anyway I don't know MySQL very well, so I'm not the guy to port this to MySQL (if it is possible to do it at all).


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Diogo
Starting Member

9 Posts

Posted - 10 March 2003 :  07:46:45  Show Profile
There is an erro in line 252:

strSqlTopics = " SELECT T.TOPIC_ID FROM FORUM_TOPICS T "

Should be:
strSqlTopics = " SELECT T.TOPIC_ID FROM " & strTablePrefix & "TOPICS T "

Nice work Rui / Optimo trabalho!!

Diogo

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 March 2003 :  09:36:00  Show Profile  Send ruirib a Yahoo! Message
I have updated the file to include the fix for the mistake found by Diogo. Thanks Diogo.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 March 2003 :  09:41:25  Show Profile  Send ruirib a Yahoo! Message
I've just found another problem, regarding searching the archives. Will post a fix in a few minutes.


Update: Corrected. Please download the new file from the previous link.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 10 March 2003 09:46:31
Go to Top of Page

Diogo
Starting Member

9 Posts

Posted - 11 March 2003 :  06:55:39  Show Profile
Can you post where you change the code for that new bug?

Obrigado!
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 March 2003 :  12:09:43  Show Profile  Send ruirib a Yahoo! Message
Basically I changed strTablePrefix by strActivePrefix in a couple places. I can't remember exactly where. If you download the current file and search for strActivePrefix and do the same in the one you have you'll find it. I don't have the files where I am now, but I may try to tell ya when I get back home, if you need it.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 11 March 2003 :  16:41:37  Show Profile  Visit PeeWee.Inc's Homepage
Could this be added to the SEARCH FORM ENHANCEMENT (Advanced Search) MOD?
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=35897

De Priofundus Calmo Ad Te Damine
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07