Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sql] select queries are blocked and not executed concurrently (sqlite) #1935

Open
rap2hpoutre opened this issue Oct 14, 2024 · 0 comments
Open
Labels
enhancement New feature or request plugin: sql

Comments

@rap2hpoutre
Copy link

rap2hpoutre commented Oct 14, 2024

Using this short code:

console.time("long");
console.time("short");
// This takes 3 seconds
db.select(
  "WITH RECURSIVE cte(x) AS (SELECT 1 UNION ALL SELECT x + 1 FROM cte LIMIT 10000000) SELECT count(x) FROM cte;"
).then(() => {
  console.timeEnd("long");
});
db.select("SELECT 1;").then(() => {
  console.timeEnd("short");
});

I have to wait the end of the first query to finish its execution to get the second query result.
It's as if each query is waiting for the following one before running itself.

Here is the result:

long: 3580.368ms
short: 3580.434ms

As you can see both query took 3.5 seconds even if the second one is fast.

Could this be fixed?

@FabianLars FabianLars added enhancement New feature or request plugin: sql labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin: sql
Projects
None yet
Development

No branches or pull requests

2 participants