evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.31k stars 202 forks source link

[Feature]: DataTable Search Optimization #2260

Closed archiewood closed 2 months ago

archiewood commented 2 months ago

Description

Improve speed of returning results when searching in DataTable

What problem would this solve?

Currently, when searching for longer strings in the datatable component, the query takes longer to execute if you type in the query character by character vs if you paste in the search query.

For reproduction, try this storybook

CleanShot 2024-07-23 at 10 53 16

How should it work?

No response

ItsMeBrianD commented 2 months ago

https://github.com/evidence-dev/evidence/blob/next/packages/lib/sdk/src/usql/query/Query.js#L1214-L1224

Likely going to involve some tuning here, along with debouncing in the datatable to ensure we aren't creating Queries not needed