Skip to content

Database: previously accessed columns cache is bound with stack trace#1136

Closed
dg wants to merge 1 commit into
masterfrom
database-caching
Closed

Database: previously accessed columns cache is bound with stack trace#1136
dg wants to merge 1 commit into
masterfrom
database-caching

Conversation

@dg

@dg dg commented Jun 12, 2013

Copy link
Copy Markdown
Member

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.

@hrach

hrach commented Jun 12, 2013

Copy link
Copy Markdown
Contributor

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:

  • what means better cache performance
  • what is it the average number of this cached keys - filesystems are becoming unusable if there is more than 1000 files in a directory

IMO: If we would accept the forbidding "two statements on the same line", we could do some other optimizations for getting caching key.

@dg

dg commented Jun 12, 2013

Copy link
Copy Markdown
Member Author

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?)

@hrach

hrach commented Jun 12, 2013

Copy link
Copy Markdown
Contributor

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.

@dg

dg commented May 4, 2014

Copy link
Copy Markdown
Member Author

Moved to nette/database#6

@dg dg closed this May 4, 2014
@dg dg deleted the database-caching branch May 4, 2014 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants