Alistair Coles 6e8d82c97e container-server: use LIMIT in get_own_shard_range() query
The get_own_shard_range() method is called during every container GET
or HEAD request (as well as at other times). The method delegates to
get_shard_ranges() which queries the DB for shard ranges. Although the
query has conditions to only select a single shard range name, and the
method will return only the first matching shard range, the query had
no LIMIT. Adding a LIMIT of 1 significantly reduces execution time
when the DB has many shard range rows.

On the author's machine, using a DB with ~12000 shard ranges this
patch reduces the get_own_shard_range() execution time by a factor of
approximately 100.

Change-Id: I43f79de3f0603b9fab8bf6f7b4c3b1892a8919b3
2023-08-03 11:48:31 -07:00
..
2023-01-19 12:56:08 -08:00
2020-05-15 22:38:04 -07:00