Instead of using static elements, use a dynamically generated DBSP-
circuit to keep views.
The DBSP circuit is generated from the logical plan, which only supports
enough for us to generate the DBSP circuit at the moment.
The state of the view is still kept inside the IncrementalView, instead
of materialized at the operator level. As a consequence, this still
depends on us always populating the view at startup. Fixing this is the
next step.
Closes#2815
This is implementation of #2801, basically repeating of `sqlite` output.
1. I do not want any bike-shedding, so I am totally fine with sqlite
version. For me it was mainly fun trying to work with Rust. On the other
hand, if it will be needed to do it somehow differently, than I am
totally fine with that. Even more fun :-)
2. I do not know where tests for this kind of things are, sorry. If
tests are needed and somebody can point to me to the place where they
can be found, I'll be more than happy to add them as well.
Currently, I can only show how it looks like this way:
```bash
> target/debug/tursodb -m records ../db1
Turso v0.1.4
Enter ".help" for usage hints.
This software is ALPHA, only use for development, testing, and experimentation.
turso> CREATE TABLE test(x INT, some_text TEXT, val DOUBLE);
turso> INSERT INTO test VALUES (100, "very important info", 23.12), (2, NULL, 3.14159265), (98, "yet another very important and long text record", NULL);
turso> SELECT * FROM test;
x = 100
some_text = very important info
val = 23.12
x = 2
some_text =
val = 3.14159265
x = 98
some_text = yet another very important and long text record
val =
```
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes#2835
```
Benchmarking Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...: Collecting 100 samples in estimated 5.008
Prepare `SELECT first_name, count(1) FROM users GROUP BY first_name HAVING count(1) > 1 ORDER BY cou...
time: [4.0081 µs 4.0223 µs 4.0364 µs]
change: [-2.9298% -2.2538% -1.6786%] (p = 0.00 < 0.05)
Performance has improved.
```
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes#2847
Instead of making a new test that would be the same, just updated this one to show that sqlite and turso (with this pr) match and isnt case sensitive in strict tables.
It's a hot instruction for TPC-H, for example, so worth optimizing.
Reduces op_zero_or_null() from 5.6% to 2.4% in CPU flamegraph for TCP-H
Q1.
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes#2842