Forum Moderators: coopster & phranque

Message Too Old, No Replies

Next page theory and efficiency considerations

         

ukgimp

12:46 pm on Mar 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello

I am trying to do the best for the server and I want to find out what is the favoured approach for scrolling though several pages of results returned from a query.

Should I perform the query and create an alias table and count the number and then when they want page 2 LIMIT is 20, 40 on the alias table?

Do you hold all the results on one long monster array and page through them?

There seem like a lot of option and I would appreciate some advice

Cheers

Nick_W

12:50 pm on Mar 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd just hold the id's in an array, but as I'll be doing this shortly I look forward to what the others think...

Nick

aspr1n

6:09 pm on Mar 7, 2003 (gmt 0)

10+ Year Member



Hi all,

Because I wanted to do as little realtime parsing as possible this was the solution I came up with.

For me the key issues were:

1. Dynamically restrict page size.
2. Don't break the page in a word or sentence, look for paragraphs.
3. Must handle HTML code in the page, so don't break the html tags either.

The solution was to pre-process the page during the upload, into 200 word blocks, where I escaped each block, and just look for the escape characters when retrieving.

There is a little bit of logic processing to contend with in regards to not breaking html tags etc, but again this can all be pre-processed.

asp.