Mr T,
(Sorry
toffee said:
Hi,
I need some pointers as I have no idea how to get started.
I have a large table which pulls data from a mysql db. Because of the large
number of records, it clugs up lot of memory and the browser massively slows
down when scrolling down.
What I would like to do is pull say 50 records and make the scrollbar as
long as if all records were retrieved; then use the on scroll event to
retrieve another 50 records based on far the scroll was (i'd assume using
ajax).
Any ideas please ?
Kind regards
T
Just another of those posts that won't help you I'm afraid, but I am very
interested in knowing if you would use the following strategy if it was
available to you: -
1) The rows are retrieved one by one and placed into your select-list/table
as they arrive from the server so that the user's interest is maintained.
2) The scroll bar shrinks as the number of rows grows (or you could have a
counter running) so the user is kept up to date with progress/feed-back
3) Your Javascript code can be enriching/adding-value to each row returned
(xlating codes into descriptions?) so you can get this crazy parallelism
thing happening to boost query performance
4) You have a hot-abort button available that will asynchronously deliver an
abort instruction to your server code (break the FOR loop on your cursor?)
5) If you hit "abort", those rows already retrieved are available for
scrutiny, and an alert message can confirm to the user that the retrieval
terminated prematurely
Sounds like the Mut's Nuts to me, but then why isn't anyone doing it?
Paging's pretty crap IMHO and without explicit server affinity control,
"Hold" cursors aren't much use, but I'm a newbie to HTML, Javascript, Ajax
so I'm sure there are other options?
I'm sure I saw a CANCEL option/call for an AJAX request the other day (MSDN
I think?) And the fact that AJAX is asynchronous means you can use a simple
HTML button for the abort trigger (and not have to worry about an Applet
dialog box like me :-() Sounds like this might work for you? Is the problem
that AJAX is so shite that it has to return the entire result set in one
message? (and if you cancel that then you merely cancel the clients receipt
of the results and never tell the server that you simply just forgot to
specify any useful keys to join on
Anyway, please report back on what you eventually decide to go with. (Maybe
the KISS principle and just ask the user for a maximum, then do a SELECT
FIRST N or LIMIT TO n ROWS)
Cheers Richard Maher
PS. More examples of what I don't know: -
Why is memory an issue to you? We are talking Virtual memory (and presumably
page files) aren't we? If it's a mutli-user system then there are page file
quotas et al aren't there? Maybe not? Browser issues?
Is there a limit on SelectList or Table size? Integer, Word? BigInt?