In case, anyone else finds this question, the only way to use server-side pagination for a table and at the same time have filters, is to create 2 queries, as suggested in this topic Search table when text input submitted, clear search when text input is deleted
The reason is that, as far as I can tell, Retool will always evaluate all input values onChange and there does not seem to be anyway to evaluate input values onSubmit. So, if you want to have a table with server-side pagination and custom filters, you must unfortunately create 2 of the exact same queries to display that table. Query1 controls the initial display for pagination and runs onChange (if you don't have onChange here, the pagination will never work). Query2 controls the filters and runs when triggered and the input values must be set with Actions to trigger Query 2 upon submit. Then in the table itself, you need to control the data source via some logic like so: {{ textInput1.value.length ? query2Filter.data : query1.data }}
I consider this kind of a hack, as Retool should somehow allow evaluation of input values onSubmit and not just onChange. That way, you would be able to use one query that runs onChange, but allow an evaluation of the textInput.value to be something like text.Input1.isSubmitted ? textInput.value : null
And why do you need server side pagination? Well client side only works for very small datasets. Once you get to any reasonable table size, client side is not practical to use, as it must grab all your data to work properly. This is obviously not viable for most situations.
EDIT: The above solution still does NOT work. Because when you put {{textInput.value}} into Query2 and set Query2 to only run manually when triggered and create the trigger in the Input field to trigger Query2 onsubmit, Query2 will still run when the textInput is changed onChange! IMHO, this is a serious bug in Retool and it's surprising there are not more posts on this. You can't use this to create custom filters at all, as all the queries will always run onChange of the input value, overloading the database! There is NO way to evaluate an inputValue only onSubmit, even though this is basic Javascript. Pretty much the only way I see how to do this is to have all the queries that table depends on to run on a trigger only and then you need to manually run the non-filter query to get all the results. This works, but is a bad UI.