-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spacetimedb::sql::query_debug_info::QueryDebugInfo (#560)
Add spacetimedb::sql::query_debug_info::QueryDebugInfo --------- Signed-off-by: james gilles <jameshgilles@gmail.com>
- Loading branch information
Showing
9 changed files
with
149 additions
and
44 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
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,3 +1,4 @@ | ||
pub mod ast; | ||
pub mod compiler; | ||
pub mod execute; | ||
pub mod query_debug_info; |
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,22 @@ | ||
use std::sync::Arc; | ||
|
||
/// Used to store the source of a SQL query in a way that can be cheaply cloned, | ||
/// without proliferating lifetimes everywhere. | ||
/// | ||
/// TODO: if CrudExpr ever gets refactored, this should probably be attached to those. | ||
/// That would be a large refactoring though. It would be nice if we could get | ||
/// more precise spans from sqlparser. We could stick all sorts of other things in here too. | ||
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] | ||
pub struct QueryDebugInfo(Arc<str>); | ||
|
||
impl QueryDebugInfo { | ||
/// Create a new [QueryDebugInfo] from the given source text. | ||
pub fn from_source<T: AsRef<str>>(source: T) -> Self { | ||
Self(source.as_ref().into()) | ||
} | ||
|
||
/// Get the source text of the query, if available. | ||
pub fn source(&self) -> &str { | ||
&self.0 | ||
} | ||
} |
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.
419cfca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark results
Benchmark Report
Legend:
load
: number of rows pre-loaded into the databasecount
: number of rows touched by the transactionunique
: a single index on theid
columnnon_unique
: no indexesmulti_index
: non-unique index on every columnperson(id: u32, name: String, age: u64)
location(id: u32, x: u64, y: u64)
All throughputs are single-threaded.
Empty transaction
Single-row insertions
Multi-row insertions
Full table iterate
Find unique key
Filter
Serialize
Module: invoke with large arguments
Module: print bulk
Remaining benchmarks