How many rows are being returned? In some cases, if you are returning a large number of rows, the time you will wait is due to communication of those rows to your browser and, if your page is complex, the time it takes your browser to render the page.
I have something similar. Through
PostgreSQL 1 minute, via build-in database 1 second. Xpath has a contains statement. (result is 1036 records)
Mx 9.24.1