BubikolRamios
06-12-2011, 05:49 PM
I have a sql that does:
Select ...
limit 10,20
I also need to know how many record are there in total, without limit.
Excluding running another sql, is there a better way to get that ?
Having something inside stored proc, but alltogether turned out to be super slow,
as oposed to running only select ... limit.
EDIT: figured out that sending sql string into stored proc
and 'executing' it via prepare statement
tremenduously slows things down !!!
So, the performance increases tremenduously even if I call db twice (for 2 sql-s) instead.
Didn't test stored proc without prepare doh.
Select ...
limit 10,20
I also need to know how many record are there in total, without limit.
Excluding running another sql, is there a better way to get that ?
Having something inside stored proc, but alltogether turned out to be super slow,
as oposed to running only select ... limit.
EDIT: figured out that sending sql string into stored proc
and 'executing' it via prepare statement
tremenduously slows things down !!!
So, the performance increases tremenduously even if I call db twice (for 2 sql-s) instead.
Didn't test stored proc without prepare doh.