I’m trying to understand how much memory my user will use on my server when the user uses a Grid app. I need to know if my SC8 app retrieves all the records from the database into memory, and hold them there, then uses it’s own pagination to pull back records in groups (10, 20, 50, etc) or, is the SC8 app smart enough to parse the SQL and pull into memory, only the records it needs. Please indicate which scenario is correct:
(In both scenarios, the user is accessing a table with 7,000 rows)
(In both scenarios, the app is started in non-filtered, non-quick searched, non-advanced searched, non-dynamic search mode… just regular mode)
SCENARIO A:
- User clicks menu item to start the app
- The App’s SQL is submitted unchanged, that pulls all records from the DB. There is no WHERE clause.
- 7000 records are held in memory on the server (for each user that is currently using this same app
- Apache/SC8 PHP paginate through the records held in memory, sending only 10,20 or 50 over the wire to the user at a time
SCENARIO B:
- User clicks menu item to start the app
- A modified version of the SQL is submitted to the DB. It has been modified to include:
FIRST 10 SKIP 0
so it now will only pull 10 records from the DB. There is no WHERE clause.
-
10 records are held in memory on the server (for each user that is currently using this same app
-
User clicks for next page
The SC8 app changes the FIRST/SKIP to read
FIRST 10 SKIP 10
and so on, meaning pagination is done via SQL (holding in memory only those records that meet the current page request) and not through PHP where ALL the records are held in memory, and PHP sends only a page over the wire at a time.
Thanks for your help.