Would it work for you to do a 3 table JOIN and then it would be one select?
You put the ON clauses in the same place as the WHERE clause with & between e.g. db((db.name.id==db.ref_table.name_id) & (db.secondname.id==db.ref_table.secondname_id)).select(..... where ref_table is your third table in your model description. On Oct 5, 12:15 am, KMax <mkostri...@gmail.com> wrote: > Hello > In trying to optimize db selects I get start to use cache=(cache.ram, > 10), but performance does not changed. > So, I start to figure out how cache works. > As I underdestand each process (or tread) has own cache in ram. > If I get db(db.auth_user.id==1).select(cache.ram,600), then this > request will be cached for 10 minutes. > What happen on this db(db.auth_user.id==2).select(cache.ram,600) ? > > Both selects will be cached, or second will push out first one? Does > cache keep results with query as key? Where are some docs about that? > > I have select from table with lots of refences, and for each I get > value from ref table. > Like > *table of name > *table of secondname > *table(ref_name,ref_secondname) > List of 100 records will generate 200 select on reference table. > > My problem is how to avoid useless selects. > > Thank you