-
Notifications
You must be signed in to change notification settings - Fork 3
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
Continue sqlc migration #385
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
SELECT | ||
* | ||
FROM | ||
group_messages | ||
WHERE | ||
group_id = @group_id | ||
ORDER BY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using this fancy case statement for sorting for now. It seems to work fine, although I'm a little worried about perf. Sometimes using a case statement will prevent the query planner from using indexes. Will try and test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about how you would do this. Would pgbench
and tools that run thorough SQL transcripts be considered a practical approach?
1163957
to
c2f0240
Compare
SELECT | ||
* | ||
FROM | ||
group_messages | ||
WHERE | ||
group_id = @group_id | ||
ORDER BY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about how you would do this. Would pgbench
and tools that run thorough SQL transcripts be considered a practical approach?
@37ng pgbench is great. I was thinking just the simplest approach of running the query with and without the CASE statement through |
@neekolas That's pretty cool! |
@37ng did the test in Retool and the query plan looks identical |
tl;dr
What's next
No urgency at all on these, but at some point I'd like to get rid of the rest of Bun in the repo and remove the dependency. That would involve:
bun.Migrate
with another migration tool and porting over our migrationsauthz
database withsqlc
queries (should be super easy, there's maybe 2 queries)