Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 303597

Make K/V store for database faster by using upsert OR get() before set()

$
0
0

Problem/Motivation

- K/V store uses a merge() query
- Merge() does do DELETE + INSERT _every_ time
- Therefore the data is always written - even if its the same

Proposed resolution

- Use an upsert() instead
- While upsert() usually can only be used when there is one key, the implementation works fine to update also the collection as long as (key, collection) is a unique index. (and it should be)

- In case we don't want upsert, we could get() before set() and not set() if its the same - we are racy anyway, so the get() before set() is not a problem.

Both save 3s / 80s for installation of standard profile.

Remaining tasks

- Do it


Viewing all articles
Browse latest Browse all 303597

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>