On Mon, Jun 17, 2024 at 12:54 PM Mike Pattrick <[email protected]> wrote:
>
> Currently all OVSDB database queries except for UUID lookups all result
> in linear lookups over the entire table, even if an index is present.
>
> This patch modifies ovsdb_query() to attempt an index lookup first, if
> possible. If no matching indexes are present then a linear index is
> still conducted.
>
> To test this, I set up an ovsdb database with a variable number of rows
> and timed the average of how long ovsdb-client took to query a single
> row. The first two tests involved a linear scan that didn't match any
> rows, so there was no overhead associated with sending or encoding
> output. The post-patch linear scan was a worst case scenario where the
> table did have an appropriate index but the conditions made its usage
> impossible. The indexed lookup test was for a matching row, which did
> also include overhead associated with a match. The results are included
> in the table below.
>
> Rows                   | 100k | 200k | 300k | 400k | 500k
> -----------------------+------+------+------+------+-----
> Pre-patch linear scan  |  9ms | 24ms | 37ms | 49ms | 61ms
> Post-patch linear scan |  9ms | 24ms | 38ms | 49ms | 61ms
> Indexed lookup         |  3ms |  3ms |  3ms |  3ms |  3ms
>
> I also tested the performance of ovsdb_query() by wrapping it in a loop
> and measuring the time it took to perform 1000 linear scans on 1, 10,
> 100k, and 200k rows. This test showed that the new index checking code
> did not slow down worst case lookups to a statistically detectable
> degree.
>
> Reported-at: https://issues.redhat.com/browse/FDP-590
> Signed-off-by: Mike Pattrick <[email protected]>
>
> ---
>
> v2:
>  - Included txn in index code
>  - Added benchmarks
>  - Refactored code
>  - Added more tests
>  - Now a mock row is created to perform the search with standard
>  functions
> Signed-off-by: Mike Pattrick <[email protected]>

Recheck-request: github-robot

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to