Performance question in combination with a pager.
Posted: Sat May 14, 2005 3:03 am
Hi,
I’m using a pager (page-slider), you know, a indicator that show the number of pages, your current page and a previous and next arrow.
I want to use this to boost performance, so I don’t need to read ALL records from the database but only a select few, being the records that are shown on that page.
But my pager needs to know how many records there are in total. So this means I need to do a normal query to figure out how many records I need. But then I do not have a performance advantage.
I query the database every time I load the page.
Is a query with a LIMIT faster then a query without one?
Is there a way to get the number of record in a table in a quicker way then a “normal” query?
Should I not query the database every time I reload the page?
How do you guys do stuff like this?
Hope to get some answers!
Kind regards,
Emiel Romein
Netherlands, the
I’m using a pager (page-slider), you know, a indicator that show the number of pages, your current page and a previous and next arrow.
I want to use this to boost performance, so I don’t need to read ALL records from the database but only a select few, being the records that are shown on that page.
But my pager needs to know how many records there are in total. So this means I need to do a normal query to figure out how many records I need. But then I do not have a performance advantage.
I query the database every time I load the page.
Is a query with a LIMIT faster then a query without one?
Is there a way to get the number of record in a table in a quicker way then a “normal” query?
Should I not query the database every time I reload the page?
How do you guys do stuff like this?
Hope to get some answers!
Kind regards,
Emiel Romein
Netherlands, the