ADODB ->numRows() or COUNT(*) $ADODB_COUNTRECS

21 views Asked by At

Optimization question. There is an $ADODB_COUNTRECS parameter that makes requests immediately counting the number of lines. However, he constantly makes this request, and it is often unnecessary. I'm trying to turn off $ADODB_COUNTRECS and also do a separate COUNT(*) query.

**Is it more effective or not? **

And secondly, if I turn off $ADODB_COUNTRECS, then in some cases it does not allow me to make a new request to the database until the output of the previous request cycle is completed. In this case, I use ->getArray() , then the array is multidimensional.

So which method is ultimately better? leave the ->numRows() or make a separate request COUNT(*) and turn off $ADODB_COUNTRECS

the best way to reduce load and increase site speed

IN additional microtime

Execution time with numRows(): 0.2532958984375 seconds Execution time without numRows(): 0.00015091896057129 seconds

0

There are 0 answers