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

[BUG]: db.query creates slow (?) queries in related queries #3581

Open
1 task done
gituser-rs opened this issue Nov 19, 2024 · 0 comments
Open
1 task done

[BUG]: db.query creates slow (?) queries in related queries #3581

gituser-rs opened this issue Nov 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gituser-rs
Copy link

gituser-rs commented Nov 19, 2024

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.36.3

What version of drizzle-kit are you using?

0.28.1

Other packages

No response

Describe the Bug

I am new into SQL "Performance", but I guess SELECT * is not a good idea. I have checked for other reports, but found nothing related.

Here is the slice of query produced by drizzle:

 (SELECT json_array(`ads_user`.`support`) AS `data`
   FROM
     (SELECT * FROM `users` `ads_user` WHERE `ads_user`.`id` = `ads`.`userId` LIMIT 1) `ads_user`) `ads_user`

but SELECT ads_user.support works flawlessly

My relational query selects only support:
screenshot

@gituser-rs gituser-rs added the bug Something isn't working label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant