Files
turso/core
Jussi Saurio a63e12f793 Merge 'treat parameters as "constant" within a query' from Nikita Sivukhin
Right now tursodb treat parameters/variable as non-constant. But
actually they are constant in a sense that parameters/variables has
fixed value during query execution which never changes.
This PR makes tursodb to treat parameters as constant and evaluate
expressions related to them only once.
One real-world scenario where this can be helpful is vector search
query:
```sql
    SELECT id, vector_distance_jaccard(embedding, vector32_sparse(?)) as distance
    FROM vectors
    ORDER BY distance ASC
    LIMIT ?
```
Without constant optimization, `vector32_sparse` function will be
executed for every row - which is very inefficient and query can be 100x
slower due to that (but there is no need to evaluate this function for
every query as we can transform text representation to binary only once)

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3936
2025-11-12 11:46:10 +02:00
..
2025-10-20 14:47:47 -03:00
2025-11-09 16:04:16 +04:00
2025-11-05 20:53:34 +04:00
2025-11-11 22:47:25 +04:00
2025-11-10 17:20:15 +01:00
2025-09-24 18:06:55 -03:00
2025-11-11 22:22:34 +04:00
2025-06-30 10:01:03 +03:00
2025-11-10 17:20:15 +01:00
2025-11-05 20:44:43 +04:00
2025-10-16 01:22:54 -03:00
2025-01-28 14:55:38 -05:00
2025-11-09 11:08:52 -05:00
2025-09-30 14:52:59 +04:00
2025-10-09 19:00:40 +03:00
2025-09-22 16:37:31 +03:00
2025-06-30 09:54:13 +03:00