Why dhtmlxgrid send two requests to db using connecter

When I looked at the sample of “01_basic.html+ Grid_01_BasicConnector.java of dhtmlxConnector_java”. I found that two requests was sent to db every time when the grid is initialized. another found that even the dynamic loading config is there, the whole set data of table is still loaded into resultset in two db requests. I wonder why the logic were like these. Is it correct?

Client side sends one request to DB, which triggers 2 db queries.
First - get count of records in related DB tables
Second - takes necessary rows only from DB, it must not retrieve all data.

Which DB type you are using?