PHP | pagination | DB
- Started
- Last post
- 5 Responses
- blastofv
alright, my programmer might very well be dropping the ball on my Identity Archives Project site, and I need some help from you PHP people
http://www.identityarchives.com
The search results (upper left search bar) take forever to come back, and the guy that put it together says it's got something to do with the way the pagination is coded... any thoughts guys/gals?
- UndoUndo0
ask him how he's doing it, if he return all the results and counts through until it gets to the required start point it will get heavy when there are lots of rows.
Optimized queries:
he needs to use a statement like this
SELECT column FROM table
LIMIT 10 OFFSET 10whihc would return 10 results starting from the 10th one ie. 11-20
- UndoUndo0
sorry that would be results 10-19
- blastofv0
Thanks Undo - so does it seem plausible that the pagination and results coding is slowing things down? it takes way too long for the first results to come back, and I need it to be quick like on a stock photography site...
- UndoUndo0
the more items (rows) that are returned from the db will mean the longer it takes the code to process the script, if the code has to sort through all of them instead of just fetching a handful then it will slow down as the database gets bigger.
it also depends on how yr db is designed(optimised) and whether your searches are on indexes or in Boolean mode.
if you are searching on idexes these will need to be re-created as more info is added to keep the db performing well. that probably means nothing to you but should mean more to yr developer.
the http://dev.mysql.com/ website has lots of info on how to optimise
- blastofv0
thanks a lot!
and you're right, that might as well have been Chinese for the most part.