Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ CMS (All) ⇒ CVS Info ⇒ 7/22 Important new function


7/22 Important new function
Global information regarding the state of our CVS and changes committed. Members are only allowed to reply to these topics.
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  CVS Info

View previous topic :: View next topic  
Author Message
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Fri Jul 23, 2004 2:50 pm
Post subject: 7/22 Important new function

To reduce system load i've reread the mysql.php class for db reading.

Normally it stores all query info into the class so you can recieve fieldset information.
This is now obsolete since there's none file which needs the information.

Function sql_fetch_unbuffered_rowset() is added to the class and should speed things up drastically especialy on large queries.
But what does the function do ?
You run a query thru it BUT it doesn't buffer the output which reduces memory usage and a small speed increase.
Since the result is unbuffered you need to fetch all data or else the result gets lost, so it puts the result in a rowset (sql_fetchrowset) and returns all data unbufferd.
example:
PHP:
$smilies = $db->sql_fetch_unbuffered_rowset('SELECT * FROM '.$prefix.'_bbsmilies', __FILE__, __LINE__);
This way you have all needed data fast in a rowset without bloating the system. The old depreciated way is
PHP:
$result = $db->sql_query('SELECT * FROM '.$prefix.'_bbsmilies', false, __FILE__, __LINE__);
$smilies = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
Stephen
Silver Supporter
Silver Supporter

Offline Offline
Joined: Apr 21, 2004
Posts: 734

PostPosted: Fri Jul 23, 2004 5:09 pm
Post subject: Re: 7/22 Important new function

Thats very very cool DJ


Stephen's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Cent OS :: 1.3.34 :: 4.1.13 :: 4.4.2 :: CVS
Back to top
View user's profile Visit poster's website Photo Gallery
alexm
500+ Posts Club
500+ Posts Club

Offline Offline
Joined: Apr 20, 2004
Posts: 574
Location: Lafayette, LA USA
PostPosted: Sat Jul 24, 2004 5:41 pm
Post subject: Re: 7/22 Important new function

DJMaze wrote:
Function sql_fetch_unbuffered_rowset() is added to the class and should speed things up drastically especialy on large queries.

Something tells me that DJ stands in front of microwave oven yelling "Hurry Up!" Smile

And just when we thought is_user couldn't possibly get any faster... Wink

Just removing the need to access $db->sql_fetchrow() and $db->sql_freeresult() from outside of the $db class should provide a slightly noticable boost.

Kudos!

(p.s. remind me never to loan you my car)

_________________
The master will be pleased...

alexm's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Shared Host / Linux / Apache 1.3.23 / Mysql 3.23.58 / PHP 4.3.3 / CPG 8.2b & 8.3CVS
Back to top
View user's profile Visit poster's website Photo Gallery
Stephen
Silver Supporter
Silver Supporter

Offline Offline
Joined: Apr 21, 2004
Posts: 734

PostPosted: Sat Jul 24, 2004 5:43 pm
Post subject: Re: 7/22 Important new function

alexm wrote:
Something tells me that DJ stands in front of microwave oven yelling "Hurry Up!" Smile
...
(p.s. remind me never to loan you my car)

LMAO Laughing Laughing Laughing Laughing Laughing Laughing Laughing


Stephen's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Cent OS :: 1.3.34 :: 4.1.13 :: 4.4.2 :: CVS
Back to top
View user's profile Visit poster's website Photo Gallery
DJ Maze
Developer
Developer

Offline Offline
Joined: Apr 19, 2004
Posts: 5683
Location: http://tinyurl.com/5z8dmv
PostPosted: Sat Jul 24, 2004 6:01 pm
Post subject: Re: 7/22 Important new function

Indeed my microwave has already 900watts but is still slow


DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
Back to top
View user's profile Visit poster's website Yahoo Messenger Photo Gallery
yrret
Newbie
Newbie

Offline Offline
Joined: Apr 19, 2004
Posts: 15
Location: Southern California
PostPosted: Mon Jul 26, 2004 4:48 am
Post subject: Re: 7/22 Important new function

very cool.
By the way it is deprecated. Normally I don't obsess on typos, but I thought it might get searched on.

_________________
--
Microsoft is not the answer.
It is the question.
The answer is "NO!"

yrret's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Various, depends on server
Back to top
View user's profile Visit poster's website AIM Address MSN Messenger Yahoo Messenger Photo Gallery
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Sat Oct 27, 2007 8:35 pm
Post subject: Re: 7/22 Important new function

I haven't seen this function before, would is still be good to use:

PHP:
$result = $db->sql_fetch_unbuffered_rowset('SELECT * FROM '.$prefix.'_table');

instead of:
PHP:
$result = $db->sql_query('SELECT * FROM '.$prefix.'_table');
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

?

Though, I'm too lazy to look up what's the difference in fetchrow and fetchrowset.


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 489
Location: CO
PostPosted: Sun Sep 13, 2009 6:41 pm
Post subject: Re: 7/22 Important new function

I've seen but did not understand what it does.


what's the difference in fetchrow and fetchrowset. ?

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Sun Sep 13, 2009 7:33 pm
Post subject: Re: 7/22 Important new function

With fetchrow you can fetch a row in case of one result or iterate through multiple results with while loop for example. fetchrowset returns array (I'm just guessing actually). I'm not sure if there is difference in speed.


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  CVS Info
Page 1 of 1
All times are GMT



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.
· Removed index.php depency.
· v9 fixed menu hoverings on touch screens.
· Fixed menu hoverings on touch screens.
· Fixed empty $Module object

devamı...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy