If you want to retrieve the first 20 records from the database table, you can use the “custom” range option in your retrieve action, as shown below:
Docs about that can be found here: https://docs.mendix.com/refguide/retrieve/#332-range
We also have some docs about retrieving in batches: https://docs.mendix.com/howto7/monitoring-troubleshooting/detect-and-resolve-performance-issues/#batches
Hope this helps!