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

The same query runs fine in TablePlus but is incredibly slow with node-sqlite3 #1744

Open
JuanDouek opened this issue Jan 3, 2024 · 0 comments
Labels

Comments

@JuanDouek
Copy link

Issue Summary

Hi, this is a query, as an example, that runs incredibly slow.
In node-sqlite3: 15 seconds!!
In TablePlus: 15 miliseconds
Whats going on?

SELECT
	1 isGroup
	, id
	, name
	, count(i) count
	, substr(group_concat(poster_path),1,200) thumb_id
FROM (
	SELECT g.id id
			, g.name name
			, i.id i
			, poster_path poster_path
	FROM genre g
	LEFT JOIN movie_genre j ON g.id = j.genre_id
	LEFT JOIN (
		SELECT * FROM movie
		WHERE deleted IS NULL AND private IS NULL
	) i ON i.id = j.movie_id
	
	ORDER BY i.id
)
GROUP BY name
ORDER BY id
LIMIT 1000;

Steps to Reproduce

  1. Run a similar query with node-sqlite3 and with TablePlus.

Note: The movie table has 2497 rows, the genre table has only 23 rows and movie_genre has 5926 rows.

Version

5.1.6

Node.js Version

16.18.0

How did you install the library?

npm, Mac Ventura, 2,8 GHz Intel Core i5

@JuanDouek JuanDouek added the bug label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant