From: Tomas S. <tom...@gm...> - 2010-12-12 10:33:20
|
Hello Currently TOra cache is not utilised enough and therefore TOra re-executes the same queries again and again. http://torasql.com/knowhow:cache What do you think about extending cache functionality in following way: 1. Update cache while TOra is running (currently cache is only updated when opening connection). This would mean saving results of queries performed by user, obsolete data when user updates information about some objects etc. 2. Make cache store information which was actually required at least once (and eventually stop querying information about all objects even if user does not need that). 3. Save cache when closing connection. Attached is an example patch which does this: 1. Saves date when a particular record in cache was updated (to be used later for targeted clean-up of outdated cache parts). 2. Saves information about list of tables, views, sequences etc. when they are queried from database in schema browser. 3. Uses cached lists in schema browser (currently list content is re-queried each time active tab is changed). 4. Saves cache when closing connection. Any ideas why I should not commit this? Something which must be added with this? == C++ == Can somebody give me ideas about these two: 1. In tocache.cpp I've removed include of boost preprocessor local.hpp as it was causing compilation errors. Is it OK? This include was copied from original toconnection.cpp. 2. Cache class does not know about a structure used to store data in toResultModel (and I cannot include that as it introduces some circular dependencies). Therefore cache returns data in simple QList<QList<QVariant>> which later has to be looped through and converted to QList<QList<toQValue>>... Is there any way to make this faster/more elegant? (see changes to toresultmodel.cpp) Thank you -- Tomas Straupis |