General ⇒ DVCS Info (Mercurial/CVS) ⇒ 7/22 Important new function ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexDVCS Info (Mercurial/CVS)

7/22 Important new function Reply to topic


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:
$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
$result = $db->sql_query('SELECT * FROM '.$prefix.'_bbsmilies', false, __FILE__, __LINE__);
$smilies = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Thats very very cool DJ

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Cent OS :: 1.3.34 :: 4.1.13 :: 4.4.2 :: CVS


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

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


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

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Cent OS :: 1.3.34 :: 4.1.13 :: 4.4.2 :: CVS


Indeed my microwave has already 900watts but is still slow

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


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!"

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Various, depends on server


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

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


instead of:
$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.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


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


what's the difference in fetchrow and fetchrowset. ?

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


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.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-

All times are UTC


Jump to: