Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Paging Efficiency Query

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Shaggy 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?

<
10   L A T E S T    R E P L I E S    (Newest First)
Shaggy Posted - 27 September 2006 : 13:33:34
Just bumping this one for the dev team's consideration

<
Shaggy 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

<
tribaliztic 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 =))
<
HuwR 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<
Shaggy 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.

<
Podge Posted - 26 October 2005 : 08:52:21
Well caught Shaggy.<
tribaliztic Posted - 26 October 2005 : 08:13:43
Hm.. Is this something we all should fix? =)
Everything that can speed up the site is interesting..
<
Shaggy 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.

<
Podge Posted - 25 October 2005 : 15:29:43
Actually, I think this would work too


if mypage > 1 then
	intOffset = cLng((mypage-1) * strPageSize)
	strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
end if
<
Podge Posted - 25 October 2005 : 15:27:33
You're right. Can't you just add something like this

if mypage > 1 then
	intOffset = cLng((mypage-1) * strPageSize)
	strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
else
        'mypage = 1
	strSql5 = " LIMIT 0, " & strPageSize & " "
end if
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07