Can build indexes on new columns
This commit is contained in:
parent
8139112934
commit
b0f05f36f2
5 changed files with 110 additions and 14 deletions
|
|
@ -148,11 +148,38 @@ async fn main() -> Result<()> {
|
|||
|
||||
{
|
||||
let mut cursor = store.read_cursor().await.map_err(|e| e.to_io_or_panic())?;
|
||||
let entries = cursor.index_lookup(0, &1).await.map_err(|e| e.to_io_or_panic())?;
|
||||
let column = 0;
|
||||
let value = 1;
|
||||
let entries = cursor.select_entries_where_eq(column, &value).await.map_err(|e| e.to_io_or_panic())?;
|
||||
println!("ARE INDEXES WORKING???");
|
||||
println!("{:?}", entries);
|
||||
}
|
||||
|
||||
{
|
||||
let mut cursor = store.read_cursor().await.map_err(|e| e.to_io_or_panic())?;
|
||||
let column = 1;
|
||||
let value = 2;
|
||||
let entries = cursor.select_entries_where_eq(column, &value).await.map_err(|e| e.to_io_or_panic())?;
|
||||
println!("ARE INDEXES WORKING???");
|
||||
println!("{:?}", entries);
|
||||
}
|
||||
|
||||
{
|
||||
let column = 1;
|
||||
println!("BUILDING AN INDEX");
|
||||
store.attach_index(column).await.map_err(|e| e.to_io_or_panic())?;
|
||||
println!("INDEX BUILT!");
|
||||
|
||||
let mut cursor = store.read_cursor().await.map_err(|e| e.to_io_or_panic())?;
|
||||
let value = 2;
|
||||
let entries = cursor.select_entries_where_eq(column, &value).await.map_err(|e| e.to_io_or_panic())?;
|
||||
println!("ARE INDEXES WORKING???");
|
||||
println!("{:?}", entries);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// {
|
||||
// let mut cursor = store.read_cursor().await.map_err(|e| e.to_io_or_panic())?;
|
||||
// let column = 3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue