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:51:16 +0000 (12:51 -0600)
commit9a9edc6c9e8307410316b30e4f5028facd13a083
treeadfc42ee575cd847c80fb37d5bc3d22e603d476e
parentb0b28446c1e5f76c54b823bc3f4e2a5423c9c79b
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