-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new experimental feature: QueryGraphs (#56)
* Add a new experimental feature: QueryGraphs This is the first step to QueryGraphs on production. There are no precise measurements yet, but it gives us power to execute queries that would be completely impossible to optimize before. For example: ``` ursadb> select into iterator {1? 2? 3? 4? 5? 6? 7? 8?}; [2020-04-14 23:17:11.177] [info] { "result": { "file_count": 5, "iterator": "1c36d313", "mode": "iterator" }, "type": "select" } ``` There are only 5 files (out of 50k) in the result, a reduction factor of 1/10k. Not bad. The performance is... better than expected (there are basically no optimisations yet), but needs testing on bigger datasets. The most important caveat is that this is not stable yet. It's relatively easy to kill the DB using a query like: ``` select {?? ?? ?? ??}; ``` We need a way to prune query graphs during expansion, but I'll leave it for future PRs (this one is big enough already). To test, configure cmake with EXPERIMENTAL_QUERY_GRAPHS: ``` cmake -DEXPERIMENTAL_QUERY_GRAPHS=ON .. make ``` * Forgotten include (works on my machine!) * Fix formatting this time...
- Loading branch information
Showing
21 changed files
with
294 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
|
||
#include <set> | ||
#include <variant> | ||
|
||
#include "Query.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
namespace feature { | ||
|
||
#ifdef EXPERIMENTAL_QUERY_GRAPHS | ||
constexpr bool query_graphs = true; | ||
#else | ||
constexpr bool query_graphs = false; | ||
#endif | ||
|
||
} // namespace feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.