I haven’t timed the queries but there’s way more than 4 queries to be done.

For instance if I build a drill-down to zoom in on my city (Bordeaux), I would 
need to build something like this :

Aquitaine (administrative_area_level_1)
Gironde (administrative_area_level_2)
Bordeaux (locality)
Talence
etc.

So to build the whole tree I’d need to do nested loops over the first two 
fields (administrative_area_level_1 & administrative_area_level_2).
Assuming there’s N administrative_area_level_1 and M 
administrative_area_level_2, I’d need N*M queries to list all localities.

That seems a bit brutish.


I’ve read a bit about nested_queries in web2py but there isn’t much to be 
found. Is it a deprecated mechanism ?

Should I use rows.find() & rows.sort() then ?


> Le 11 févr. 2015 à 20:28, Niphlod <niph...@gmail.com> a écrit :
> 
> did you actually timed the queries ? without knowing the cardinality of the 
> sets, it's pretty impossible to say that a single big-query will be more 
> efficient than 4 on small subsets.
> 
> -- 
> Resources:
> - http://web2py.com <http://web2py.com/>
> - http://web2py.com/book <http://web2py.com/book> (Documentation)
> - http://github.com/web2py/web2py <http://github.com/web2py/web2py> (Source 
> code)
> - https://code.google.com/p/web2py/issues/list 
> <https://code.google.com/p/web2py/issues/list> (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/yF1UHKQqseI/unsubscribe 
> <https://groups.google.com/d/topic/web2py/yF1UHKQqseI/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com 
> <mailto:web2py+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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.

Reply via email to