Re: joinAdd question
| From: | Justin Patrin | Date: | Wed, 08 Dec 2004 08:27:50 +0000 |
| Subject: | Re: joinAdd question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16102@lists.php.net to get a copy of this message | ||
On Wed, 08 Dec 2004 05:55:45 -0200, Jacques <iacques@yahoo.com.br> wrote:
> It´s the folow:
>
> In this query, i get 5000 rows from 1o reg, ok. The benchmark is +- 7
> seconds; : )
>
> $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!
>
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.
--
Justin Patrin