#1299 closed defect (bug) (duplicate)
Why are we grabbing data immediately before we update it?
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.1 | Priority: | low |
Severity: | minor | Version: | |
Component: | Back-end | Keywords: | |
Cc: |
Description
Currently, when we update meta, we grab the meta directly from the database, either insert the new data or update the old data (assuming that the old data is not exactly the same as the new data), and then delete the data from cache.
Wouldn't it be more efficient to check if the data is the same as the cache, and if it isn't, update, and if that doesn't change any rows, insert? After that, it makes sense to store the data directly in cache as well.
The current method uses 1-2 queries, plus the extra one needed to retrieve the data after it has been deleted from cache. This method would take anywhere from 0-2 queries, with no missing cache.
Is there some fundamental reason that this method won't work, or am I the first one to think of it?
#995