PHP Classes

what about performance

Recommend this page to a friend!

      CRDB  >  CRDB package blog  >  Request for feedback  >  All threads  >  what about performance  >  (Un) Subscribe thread alerts  
Subject:what about performance
Summary:what about performance?
Messages:5
Author:saurabh sharma
Date:2009-03-31 16:11:45
Update:2009-04-01 16:14:13
 

  1. what about performance   Reply   Report abuse  
Picture of saurabh sharma saurabh sharma - 2009-03-31 16:11:45
This is really very good class.
I want to know about the performance issues?
I just print_r some of the objects and found a lot of information in those objects.

Can this create a problem in speed?

some more points...

1) multiple OR in condition
2) Group By ?
3) what about mysql functions like MAX(), DISTINCT(), AVG() ?


Thanks

  2. Re: what about performance   Reply   Report abuse  
Picture of Sandeep.C.R Sandeep.C.R - 2009-04-01 04:40:01 - In reply to message 1 from saurabh sharma
i really dont think speed will be affected by objects size.if you have worked in drupal or someting like that,they have really huge objects.

The result is stored in an array for iteration ,So if your result is really huge,there might be a problem.But that can be fixed..

I have added support for MAX(),MIN() GROUP BY etc recently.Please download the latest version of the class.Also download the howto.html which decsribes the usage of these new features...below i am adding the section that explains the usage for Mysql functions


To find the max,min.sum or average value for a column in rowset ,

$rowset=$db->user();

$max_key=$rowset->max()->key;

$min_key=$rowset->min()->key

$sum_key=$rowset->sum()->key;

$average_key=$rowset->avg()->key ;or $rowset->average()->key;

This can be used with JOINS also.Just use the `tablealias_columnname` format while refereing to
columns for these functions.

Thanks,
Sandeep

  3. Re: what about performance   Reply   Report abuse  
Picture of Sandeep.C.R Sandeep.C.R - 2009-04-01 04:44:01 - In reply to message 1 from saurabh sharma
regarding multiple OR ,
I assume by multiple or you mean clasues like ' or(condition 1 and condition 2)...'.

I am not sure if I should add that to the class. Could not find a neat way of adding it.

  4. Re: what about performance   Reply   Report abuse  
Picture of Sandeep.C.R Sandeep.C.R - 2009-04-01 12:49:41 - In reply to message 3 from Sandeep.C.R
i have added support for OR groups,an OR group can be added as

$rowset=$db->user()->name('user')->or()->start_group()->no(50)->key(100)->end_group();

not very neat... i know...



  5. Re: what about performance   Reply   Report abuse  
Picture of saurabh sharma saurabh sharma - 2009-04-01 16:14:13 - In reply to message 2 from Sandeep.C.R
Thanks for reply and thanks for this good class...
I'll definitely use this class in my future projects...

:)

Thanks!