phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

session_pagestart on every page (big resource waste)


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
qspy
Board Member



Joined: 03 Nov 2009

Posts: 10



PostPosted: Tue Nov 10, 2009 3:37 pm 
Post subject: session_pagestart on every page (big resource waste)

I think, that grabbing everything (u.*, s.*) like query below is bad for performance, disk reads and network traffic.

Code:
                $sql = "SELECT u.*, s.*
                        FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
                        WHERE s.session_id = '$session_id'
                                AND u.user_id = s.session_user_id";


Maybe we should made new session_pagestart function to session_pagestart_lite and use it where not all data is needed.

For example, on search.php we got session_pagestart which grabs u.*, s.* including:
user_password
user_regdate
user_session_time
user_email
user_website
user_from
user_aim
user_yim

just LOL, none of this records ( i write only this bigger data fields ) are used on search.php page and on every search.php access they are grabbed from database (hdd read waste, if master <--> slave then network traffic waste, bigger grab time etc.).

So we can make new function basing on session_pagestart and grab only most needed data, then use it everywhere where possible.

did i missed something?
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Nov 10, 2009 4:16 pm 
Post subject: Re: session_pagestart on every page (big resource waste)

It fills out the $userdata array. So you'd have to go through every script and function to see which elements from that array you were using.
_________________
Moof! Email me: dog_cow@macgui.com
Inside Allerton Park Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog
Back to top
qspy
Board Member



Joined: 03 Nov 2009

Posts: 10



PostPosted: Tue Nov 10, 2009 4:50 pm 
Post subject: Re: session_pagestart on every page (big resource waste)

Dog Cow wrote:
It fills out the $userdata array. So you'd have to go through every script and function to see which elements from that array you were using.


But we would not need to eliminate every non used grabbed field. For example we could do opposite way, find where user_password is used and grab it only on this page.
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Nov 10, 2009 8:35 pm 
Post subject: Re: session_pagestart on every page (big resource waste)

qspy wrote:

But we would not need to eliminate every non used grabbed field. For example we could do opposite way, find where user_password is used and grab it only on this page.

Which should be only login, profile (including resend password), and the admin_users.php file.

_________________
Moof! Email me: dog_cow@macgui.com
Inside Allerton Park Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Wed Nov 11, 2009 9:51 am 
Post subject: Re: session_pagestart on every page (big resource waste)

You won't really get noticeable performance improvement limiting the columns to more than one (especially if it is included in an index). You will get much more splitting this request in two: one for the session, one for the user.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0087 seconds using 15 queries. (SQL 0.0014 Parse 0.0002 Other 0.0071)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo