Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Odd performance question

Author  Topic 

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-03-14 : 11:33:33
I sat down and had a thought. I have a forum. Three scenarios:

1. I divide the forum listings into several pages using temporary tables.

2. I divide the forum listings into several pages using VBscipt and counts and stuff, not using any SQL temporary tables.

3. I list all entries on one page.

Question:
Considering that scenario 1 now has a massive amount of temporary tables when there are lots of users there browsing, scenario 2 only uses a lot of select requerys instead and scenario 3 lists them all in one go. Which one will actually be the fastest one when there are lots of users?

=====================================
Why not try and do the impossible?

Edited by - Swede on 03/14/2002 13:00:21

joldham
Wiseass Yak Posting Master

300 Posts

Posted - 2002-03-14 : 11:36:37
If you are running this with .asp code, I have a timing code that might give you the answer. Let me know if you are interested.

Jeremy

Go to Top of Page

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-03-14 : 11:40:33
Well, the thing is... I might have lots of entries. But witha minimum amount of users a scenario 1 would be the quickest way I think. But with a vast amount of users I believe scenario 3 to be fastest considering it's less work for the SQL...

I have no way of testing this with a massive amount of users though, was just wondering if someone had given this any thought...

At the moment I got the forum to list over 120 entries including a count (for subentries) and a join (to get the name of the poster) in less than a second using ASP... Total of 2 stored procedures...

=====================================
Why not try and do the impossible?

Edited by - Swede on 03/14/2002 11:49:49

Edited by - Swede on 03/14/2002 13:05:09
Go to Top of Page

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-03-20 : 04:08:57
Just bumping this up again to see if someone has any more comments on the matter.

=====================================
Why not try and do the impossible?
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-03-20 : 12:54:18
Swede,

I don't quite understand your question. When you say "divide the forum listings into several pages" are you talking about web-pages for display purposes? If so, I don't see any reason why you'd use temporary tables for that. For example, this forum lists up to 16 messages on one "page" and if there are more posted messages in the thread then it breaks it out to multiple pages. I haven't looked at the code, but I'd bet it's using some variation of Graz's article What's After Top?

As for stress-testing your site, you can simulate multiple simultaneous users with Microsoft's free Web Application Stress Tool (WAST). Available for download here: [url]http://webtool.rte.microsoft.com/[/url]

------------------------
GENERAL-ly speaking...
Go to Top of Page

Swede
Yak Posting Veteran

74 Posts

Posted - 2002-03-21 : 03:51:09
You understood the question correctly .
I read that article and he suggests temporary tables in there so it didn't really do anything for me...

Forums are tricky business in it's simplicity lol

Oh and yeah, I tried the stress tool before but couldn't get it working properly from here. Probably some firewall or proxy issues :(

By the way, if you want to see what I mean go to:
http://lightfoot-semicondu.securedata.net
Click on Support and login with guest/guest
The bugs forum is filled with a lot of messages and I am wondering whether it's best to leave it as it is now because it is really fast or if it's best to divide the forum listing onto several pages if more than a certain number.

And if that would impose on performance more than listing them all at once. And if that would be actually tougher on the server, really.

=====================================
Why not try and do the impossible?

Edited by - Swede on 03/21/2002 04:02:58
Go to Top of Page
   

- Advertisement -