Plus ensure reference integrity of data binding (files might be referenced more then ones).
Relatively simple patch reintroducing REPLACE INTO statement for key duplication. I added count check when calling the eviction function. It then bypasses when there are more references to a file (key+generation). IMHO it is cheapest way to do this. Refcounting means updating a table or a column every time a new file is added and reading that table/column to check the refcount. Checking the count at moment of a row deletion is in 99% very fast (using index on the key column and scan of all -in most cases just one- present generations) and also safe way to have a number of references.
The statement is IMHO wrong. If the entry is already present in another cache its ItemType flags are overwritten with the ItemType of the entry we propagate. We need separate INSERT and UPDATE statements or use some construction with LEFT OUTER JOIN (just guessing).
Don't forget to add "Flags INTEGER DEFAULT 0" to set flags to 0 when new rows are added but existing flags are not rewritten.
This is fixed version that preserves original flags. I am using two separate statements, one to propagate the new entry to all matching caches and one to set the OPPORTUNISTIC bit on all of them. Both statements are optimal.
Opportunistic caching was removed from the spec, WONTFIXing.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.