If you give a query to a repeating panel, you don’t have the data yet. The data will be fetched when the repeating panel asks for it. I don’t know the details, but Anvil might fetch one line at a time or a block of lines.
Also, if you have a column with a link to another table, the other table row will be accessed only on request. For example a user['friends']
that returns a list of rows from another table will require another query.
The work is the same, but collecting the data for a dict on the server side is much faster than doing the same on the client side.
If you create a dict on the server side and you make sure to expand the list of friends and read all the rows you need and skip the ones you don’t, the form receives the dict and will never go back to the server to ask for anything else.
Yes, sometimes the magic of data binding between the form and the database is sexier, but often is better to make a server side function that prepares all the data that you might need and return it in one shot.