[asterisk-bugs] [JIRA] (ASTERISK-24050) [patch] Improve AstDb I/O When Updating Rows

Michael L. Young (JIRA) noreply at issues.asterisk.org
Tue Jul 22 13:58:56 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael L. Young closed ASTERISK-24050.
---------------------------------------

    Resolution: Fixed

> [patch] Improve AstDb I/O When Updating Rows
> --------------------------------------------
>
>                 Key: ASTERISK-24050
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24050
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Core/AstDB
>    Affects Versions: Feature Tracker
>            Reporter: Michael L. Young
>            Assignee: Michael L. Young
>            Severity: Minor
>         Attachments: astdb-insert-update-io-help_trunk_v2.diff
>
>
> When updating a row, we are currently doing an INSERT OR REPLACE INTO.  The downside to this is that the row is deleted if it exists and then a new row is inserted.  So, we are hitting the disk twice.  One for the deletion and one for the insertion.
> The proposed patch will attempt to do an INSERT INTO and if it fails because a row with that key exists, we will ignore that.  Then we will attempt to perform an UPDATE on the existing row.  If a record was INSERTED, the UPDATE statement will end up doing nothing.
> Some testing that was performed on an older server with older IDE storage and few peers:
> _before patch_
> Re-Register | INSERT OR REPLACE INTO | Avg. 404 ms
> Register | INSERT OR REPLACE INTO | Avg. 442 ms
> _after patch_
> Re-Register | INSERT OR IGNORE; UPDATE | Avg. 361.5 ms
> Register | INSERT OR IGNORE; UPDATE | Avg 419 ms



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list