]> git.ipfire.org Git - thirdparty/asterisk.git/commit
astdb: Improve prefix searches in astdb
authorSean Bright <sean.bright@gmail.com>
Thu, 7 Dec 2017 20:19:40 +0000 (15:19 -0500)
committerSean Bright <sean.bright@gmail.com>
Sun, 10 Dec 2017 18:41:51 +0000 (12:41 -0600)
commita4b291029fc79b143a94bfbda20a32ef52321539
treefca7fc43bac1885c6d7006a323da960a15d22e72
parent54a86779a3d1cc2a1c859d76180f155865713bb5
astdb: Improve prefix searches in astdb

Using the LIKE operator requires a full table scan of 'astdb', whereas a
comparison operation is able to use the primary key index.

This patch adds a new function to the AstDB API for quick prefix matches
and updates res_sorcery_astdb to utilize it. This showed substantial
performance improvement in my test environment.

Related to ASTERISK~26806, but does not completely resolve it.

Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
include/asterisk/astdb.h
main/db.c
res/res_sorcery_astdb.c