Its grid doing this definitely. Removing the grid and all queries disapear.

I also have had one left join in grid definition, which causes some 
additional queries to auth_user database. I have striped my code to 
simplest one, now when fetching one record from my database, I'm getting 
queries as below:
a) query to category table, my record reference category table
b) 3 queries to auth_table, but I dont have any username column in grid and 
also see the strange where clause ...
c) count quersy, chis is fine
d) the main query itself, which is fine


Strange are the queries to category and auth_user tables(the first 4 
queries), particulary the where clause which is just checking id 'IS NOT 
NULL'. I don't use represent for this fields, so in category column I can 
see ID instead of name. When I add represent to this category Field, 
additional query appears like this one, which fetches that category name 
for this particular category id, which is fine.

SELECT  category.id, category.name, category.description FROM category WHERE 
(category.id = 1) LIMIT 1 OFFSET 0;


SELECT  category.name, category.id FROM category WHERE (category.id IS NOT 
NULL) ORDER BY category.name, category.id;
1.00ms
SELECT  auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id 
IS NOT NULL) ORDER BY auth_user.username, auth_user.id;
0.00ms
SELECT  auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id 
IS NOT NULL) ORDER BY auth_user.username, auth_user.id;
0.00ms
SELECT  auth_user.username, auth_user.id FROM auth_user WHERE (auth_user.id 
IS NOT NULL) ORDER BY auth_user.username, auth_user.id;
1.00ms
SELECT count(*) FROM scheduled_task_type WHERE (scheduled_task_type.id > 0);
0.00ms
SELECT  scheduled_task_type.category, 
scheduled_task_type.name,scheduled_task_type
.description, scheduled_task_type.id FROM scheduled_task_type WHERE (
scheduled_task_type.id > 0) ORDER BY scheduled_task_type.id LIMIT 1 OFFSET 0
;

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to