I am trying to resolve an issue and I want to check the SQL output but only just realised that we don’t have the debug option for Paged Record queries.
Is there a reason for the option to be missing?
Is there another way to debug Paged Record queries?
If you’re developing locally and using MySQL, I would very much recommend setting things up so you have access to the query log. This will show you exactly what queries are run, as they’re executed - not showing variables etc.
This has cropped up in a few threads, eg this one which suggested using Wappler’s terminal. I actually prefer to display the log in a text editor most of the time, set so the output is automatically updated.
I’ve never noticed any delay when log files are created, though you wouldn’t want to have them enabled on a live site.
It seems strange that 5000 lines should be created for a paged query. I have some quite complicated queries producing a single line in the query log of over 3000 characters, but this, along with the returned records, appears instantly. Perhaps this indicates a problem with your query.
It’s nested queries, so, say 500 companies from one query, then each company having average of 5 contacts fetched by a query, then each contact could have say, 5 ways of contacting (ie landline, mobile, email, facebook etc) which is another query. So that’s about 2500 query calls and about 12500 results (roughly). And it’s actually more complicated than that.