summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2017-12-29 15:49:13 +0100
committerNiklas Hambüchen <mail@nh2.me>2017-12-30 21:37:57 +0100
commit14dbd5da1cae64e6d4d2c69966e19844d090ce98 (patch)
treede35778f31d19342ef0b4622d2bc9a66f8c68f12 /libglusterfs
parent9fd17c1c3c44944ea280c4c15bad0d49b298b8a9 (diff)
glusterfind: Speed up gfid lookup 100x by using an SQL index
Fixes #1529883. This fixes some bits of `glusterfind`'s horrible performance, making it 100x faster. Until now, glusterfind was, for each line in each CHANGELOG.* file, linearly reading the entire contents of the sqlite database in 4096-bytes-sized pread64() syscalls when executing the SELECT COUNT(1) FROM %s WHERE 1=1 AND gfid = ? query through the code path: get_changes() parse_changelog_to_db() when_data_meta() gfidpath_exists() _exists() In a quick benchmark on my laptop, doing one such `SELECT` query took ~75ms on a 10MB-sized sqlite DB, while doing the same query with an index took < 1ms. Change-Id: I8e7fe60f1f45a06c102f56b54d2ead9e0377794e BUG: 1529883 Signed-off-by: Niklas Hambüchen <mail@nh2.me>
Diffstat (limited to 'libglusterfs')
0 files changed, 0 insertions, 0 deletions