mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
core/db: Revert Patch Added In Attempt To Improve I/O Performance
Reverting the patch since it was causing a regression and after fixing the regression, there were no performance gains. At least based on my method for measurement. ASTERISK-24050 Review: https://reviewboard.asterisk.org/r/3841/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -50,14 +50,7 @@ int ast_db_get(const char *family, const char *key, char *value, int valuelen);
|
||||
*/
|
||||
int ast_db_get_allocated(const char *family, const char *key, char **out);
|
||||
|
||||
/*! \brief Store value addressed by family/key
|
||||
*
|
||||
* Try to insert a row first. If a row already exists with the given key
|
||||
* we will then perform an update on this row.
|
||||
*
|
||||
* The attempt here is to increase disk I/O performance by not deleting an existing
|
||||
* row and then inserting a new row when one already exists.
|
||||
*/
|
||||
/*! \brief Store value addressed by family/key */
|
||||
int ast_db_put(const char *family, const char *key, const char *value);
|
||||
|
||||
/*! \brief Delete entry in astdb */
|
||||
|
@@ -119,7 +119,7 @@ static void db_sync(void);
|
||||
#define DEFINE_SQL_STATEMENT(stmt,sql) static sqlite3_stmt *stmt; \
|
||||
const char stmt##_sql[] = sql;
|
||||
|
||||
DEFINE_SQL_STATEMENT(put_stmt, "INSERT OR IGNORE INTO astdb (key, value) VALUES (?1, ?2); UPDATE astdb SET value=?2 WHERE changes()=0 AND key=?1")
|
||||
DEFINE_SQL_STATEMENT(put_stmt, "INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)")
|
||||
DEFINE_SQL_STATEMENT(get_stmt, "SELECT value FROM astdb WHERE key=?")
|
||||
DEFINE_SQL_STATEMENT(del_stmt, "DELETE FROM astdb WHERE key=?")
|
||||
DEFINE_SQL_STATEMENT(deltree_stmt, "DELETE FROM astdb WHERE key || '/' LIKE ? || '/' || '%'")
|
||||
|
Reference in New Issue
Block a user