On Saturday, November 26, 2016 at 5:39:49 PM UTC-5, Brian M wrote: > > Well even if you're writing the query using the DAL the actual data > processing is being done by the database itself so that's where the "short > circuiting" would need to happen and is dependent on the database's query > optimization. Try running a SQL version of the query directly against the > DB and see if it's any faster. >
And as mentioned when this question was asked on Stack Overflow, the SQL generated by this query is: SELECT count(*) FROM webhook_table WHERE ((webhook_table.status = 3) AND ( webhook_table.webhook_data LIKE '%form_id%')); So, try running that outside of web2py and see if you get the same result. As Brian noted, the database handles any query optimization -- web2py simply generates the SQL and passes it to the Python driver. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.