Yes, multi table select could be used, but I make some data processing before paging (like name+' '+secondname ), and some other more.
My question is how to cache select depend on query? (make bigger cache?) Cache stat shows 70-80% hits (it shows stat of random thread ), but each search ( page with search func ) run equal time. (if cache works, first one should run longer then second, in case search made in same thread of webserver) I checked my postgres - yes, there lot of select-queryes on each page request. On 5 окт, 15:59, ron_m <[email protected]> wrote: > 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 <[email protected]> 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

