Re: Paginating searchs = performance problem
| From: | Richard Lynch | Date: | Mon, 23 Oct 2006 21:53:24 +0000 |
| Subject: | Re: Paginating searchs = performance problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243520@lists.php.net to get a copy of this message | ||
On Fri, October 20, 2006 10:04 am, Fourat Zouari wrote:
> I have PHP/PostgreSQL application were i got a search page with some
> items
> to search, am building the search query on server side.
>
> I need to display a paginated search and for this i need to get the
> total
> count of lines matching the search before OFFSET/LIMITing my page, am
> i
> obliged to repeat the query twice ??? first to get the total count,
> second
> to get my page.
>
> it's very heavy
>
> Any one's suggesting better doing ?
Use a cursor.
http://postgresql.org/
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?