Author |
Topic |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 25 October 2005 : 11:37:25
|
Was looking at a couple of base files earlier and breezed over some of the code that handles the paging in topic.asp (although that's not the only file this appears in) spotting the following code in the MySQL specific code on line 333:if mypage > 1 then
intOffset = cLng((mypage-1) * strPageSize)
strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
end if Now, granted, I'm nowhere near an expert on optimising databases and recordsets for maximum efficiency but would it not be beneficial to remove the if statement from that block of code? As it is at the moment, when viewing the first page of a topic and using a MySQL database, all replies for the given topic are going to be pulled from the database into the database. Would it not be better to simply pull the replies we know we're going to need rather than all of them?
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
Podge
Support Moderator
Ireland
3775 Posts |
|
Podge
Support Moderator
Ireland
3775 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 26 October 2005 : 08:03:01
|
Ay, when mypage is 1, mypage-1 will be 0 and, therefore, (mypage-1)*strPageSize will also be 0.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 26 October 2005 : 08:13:43
|
Hm.. Is this something we all should fix? =) Everything that can speed up the site is interesting.. < |
/Tribaliztic - www.gotlandrace.se -
|
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 26 October 2005 : 09:11:10
|
Thanks, Podge. As I said in my original post, this appears in a few other files as well, such as forum.asp. I'll post back with a full list with line numbers shortly.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 26 October 2005 : 10:31:38
|
quote: Originally posted by tribaliztic
Hm.. Is this something we all should fix? =) Everything that can speed up the site is interesting..
only if you are using MySQL< |
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 26 October 2005 : 10:35:50
|
Okay, I'll wait for Shaggy's full list of instances and fix this on my forum then. Thanks HuwR! (And shaggy =)) < |
/Tribaliztic - www.gotlandrace.se -
|
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 26 October 2005 : 11:35:51
|
Here ye go:
admin_accounts_pending.asp - line 227 admin_emaillist.asp - line 66 forum.asp - line 283 members.asp - line 184 moderate.asp - line 130 search.asp - line 301 topic.asp - line 333
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 27 September 2006 : 13:33:34
|
Just bumping this one for the dev team's consideration
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
|
Topic |
|