mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
30885089bdac085882d04be416ecd7b140faec78
Previously, setting data props on a thing would result in a SELECT to determine which data properties already existed, and then a sequence of INSERTs and UPDATEs (with some batching) to get the database in the right state. The account master wasn't too happy with those extra selects, so we made it so that the app would optimistically UPDATE and if no rows were changed do INSERTs instead (with appropriate batching as above). Unfortunately, this greatly increases the number of operations done when adding new data props, such as at thing creation time, and on some tables that's almost entirely all of the workload. This patch takes advantage of the fact that we know no data attributes will exist at thing creation time and therefore we can blindly INSERT without doing UPDATEs or SELECTs first to try and reduce the number of extraneous operations we do.
Description
No description provided
Languages
Python
54.4%
JavaScript
26.7%
HTML
11.3%
Less
4.5%
Shell
1%
Other
2%