Database: previously accessed columns cache is bound with stack trace#1136
Database: previously accessed columns cache is bound with stack trace#1136dg wants to merge 1 commit into
Conversation
|
David, this is surely the pain of caching mechanism a this is the almost 100% right way. (It could give some wrong cached key for two statements on the same line.) The question is:
IMO: If we would accept the forbidding "two statements on the same line", we could do some other optimizations for getting caching key. |
|
By „better performance“ I mean really previously accessed columns are fetched from database, not previously accessed columns by similar query. (Yes, I was talking about DB performance, not cache performance.) Number of cached keys is very low, it nearly corresponds with number of {foreach $query} and fetch() in code. Because there is only few writes and a tons of reading, maybe we can use some smarter one-file storage for accessed columns (SQLiteStorage? Or solution based on FileJournal?) |
|
The question was more like "Is it really more effective to call debug_backtrace than fetching 'two more' columns?". FileJournal is still buggy... #76. SQLiteStorage... I would like to avoid that. |
|
Moved to nette/database#6 |
This is just experiment and breaks current tests.
Stack trace is used for resolution at which place of source code the query was executed. And executing query in different places usually means different usage.
In the worst case, there will be more items in the cache, but usually the cache will perform better. Maybe we can add some limitations for recursive code.