Re: joinAdd question
| From: | Jacques | Date: | Wed, 08 Dec 2004 13:13:03 +0000 |
| Subject: | Re: joinAdd question | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16112@lists.php.net to get a copy of this message | ||
Justin Patrin escreveu:
On Wed, 08 Dec 2004 05:55:45 -0200, Jacques <iacques@yahoo.com.br> wrote:Jacques -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.289 / Virus Database: 265.4.7 - Release Date: 7/12/2004It´s the folow: In this query, i get 5000 rows from 1o reg, ok. The benchmark is +- 7 seconds; : )Well, it does take time for the DB to select all of the records and seek to the point where you want to go.... Try turing on debugging and running the queries manually. See if the queries take the same amount of time. You have reason, the error you are not with data_object therefore delay you occur in mysql. With one join the performance is fast, however with more than one it falls frightfully...$db = new DataObject_Frm_usuario(); $total = $db->count(); $db->limit(1 , 5000); $cargo = new DataObject_Srh_cargo(); $db->joinAdd($cargo); $lotacao = new DataObject_Srh_lotacao(); $db->joinAdd($lotacao);In this query, i get only ONE (1) row from 1o reg ok. The benchmark is +- 7 seconds; : |$db = new DataObject_Frm_usuario(); $total = $db->count(); $db->limit(5000 , 1); $cargo = new DataObject_Srh_cargo(); $db->joinAdd($cargo); $lotacao = new DataObject_Srh_lotacao(); $db->joinAdd($lotacao);And if query start from 15.000 the time is +- 18 seconds.... : ($db = new DataObject_Frm_usuario(); $total = $db->count(); $db->limit(15000 , 1); $cargo = new DataObject_Srh_cargo(); $db->joinAdd($cargo); $lotacao = new DataObject_Srh_lotacao(); $db->joinAdd($lotacao);Why this happens? I don´t use the Pager with joinAdd? Thanks for any help!