View SQL generated by SQLFORM.grid

47 views
Skip to first unread message

Jim S

unread,
May 4, 2016, 3:32:10 PM5/4/16
to web2py-users
I pass a query to SQLFORM.grid.  Is there a way to see the SQL that last executed on behalf of the grid?  I'm trying to tune my db for the SQL statement used to show the list of records.

-Jim

Niphlod

unread,
May 4, 2016, 4:23:52 PM5/4/16
to web2py-users
response.toolbar() shows db statistics, I guess is the fastest method out there.

Jim S

unread,
May 4, 2016, 5:46:27 PM5/4/16
to web2py-users
I did what you suggested and I get this statement:

SELECT workorder.workorderId, workorder.parent_workorder, workorder.siteId,
workorder
.created, workorder.needed, workorder.productId,
workorder
.productName, workorder.productSiteId, workorder.pullFromStock,
workorder
.bomId, workorder.quantity, workorder.uom,
workorder
.mixerId, workorder.approvedById, workorder.actualQuantity,
workorder
.completed, workorder.hasMolasses, workorder.brixLevel,
workorder
.hasUrea, workorder.ureaConcentration, workorder.rfLevel,
workorder
.phLevel, workorder.tankNumber, workorder.sent,
workorder
.allowToFinalize, workorder.temperature, workorder.transaction_date,
workorder
.scale_weight
FROM workorder
WHERE (workorder.workorderId = 47291) LIMIT 1 OFFSET 0;


about 43 times.

And about an equal number of select statements on auth_membership and auth_permission

But, nowhere do I see the SQL Statement that should be driving my SQLFORM.grid SELECT statement.  I know it should include my 'product' table (I have it specified on the 'left' argument).  But, searching the page, there are no references to it.

Any way to get it from the grid object returned from SQLFORM.grid?

-Jim
Reply all
Reply to author
Forward
0 new messages