Repository navigation
Build tool search - #1304
Build tool search#1304PragTob wants to merge 2 commits into
Conversation
|
I'd still like to discuss the need for an index - I could add benchee and try to write a benchmark but due to the data setup required that may be quite extensive 😅 |
|
Tests are failing due the good old retired runner... gimme a sec (hopefully) |
|
Amazing! Thank you @PragTob !! RE an index: my thought is that there's not many releases per package, so perhaps it's not so impactful. It or some other optimisation could be a later addition if it is discovered in production that better performance is desired. |
Basic implementation of searching for package by build tool. Fixes hexpm#1300 I think adding an index on build tool is still a worthwhile discussion, although I'm unsure because we're already filtering by package_id - but maybe a combined index is worth the overhead. Naturally, I'd love to write a benchmark but oh well 👀
I'm quite fond of little test helpers, I think it helps the tests focus on the essentials by taking a lot of unnecessary noise/arguments out of the way - so they make reading and writing nicer :)
|
(rebased against main to pick up the CI changes so that CI can pass fully hopefully) |
|
Hello @wojtekmach! Please excuse my tagging you 🙏 We're looking to add a new feature to the Gleam package search site and whether or not the Hex API has this feature dictates how we will implement it. Is this contribution likely to be accepted? We're also happy to help with anything that needs refining here also. Thank you again! |
|
No worries, thanks for the ping, we're keen on moving forward with this. |
|
Great, thank you! |
|
I think it'd be nice to have a conclusion whether an index would be useful for this. We have 21k packages total and 203k releases total, could you try with some synthetic data? If it'd be useful I could send you a prod dump of public packages and releases tables. |
|
@wojtekmach you're asking ME to BENCHMARK something? I can't promise any time line, sadly the reason for my visit in Warsaw isn't too happy overall and so I'll be busy the next 2 weeks. Thanks for the feedback that the feature itself is wanted and a benchmark would be helpful, that way I know it's worth investing the time 🎉 |
ericmj
left a comment
There was a problem hiding this comment.
Looks good, but after checking with EXPLAIN I think we need the index, it changes the query from 150ms -> 20ms.
So lets go with something like: CREATE INDEX releases_meta_build_tools_idx ON releases USING GIN ((meta->'build_tools'));
|
Hey @ericmj thank you very much. I shall do that, maybe this weekend. I'd still like to do the benchmark. My time has been limited (new job, and most recently a close friend passed) so no promises as usual. |
|
Hello folks! Would it be useful for one of the Gleam peeps to add this last index? |
|
@lpil Yes, please go ahead. |
|
Currently this breaks when using |
|
I have added the suggested index, added a test case for the package_controller and fixed the remaining problem in a PR to this PR. Let me know if there is something I should do differently. |
|
👋 Just came around to have a look at this again. Thanks @kwando Sorry for the inactivity, losing Piotr and some other stress had a bigger impact on me than I thought at the time. Should be ready for some more action again but it seems that's not needed any more. I might still add the the benchmark at some point.... for science but that can be done separately and sometimes I go too hard on these things 😅 |
|
@PragTob Glad you are feeling better :) The same changes made are made to your PR-branch in your repo if you wanna bring them into this PR. |
|
Don't say sorry @PragTob! That's a real tough situation, and we're grateful for your help. Glad you're doing good 💜 |





Basic implementation of searching for package by build tool.
Fixes #1300
I think adding an index on build tool is still a worthwhile
discussion, although I'm unsure because we're already filtering
by package_id so I don't think just an index on that field would be very effective - but maybe a combined index is worth the overhead.
Naturally, I'd love to write a benchmark but oh well 👀
This is done by the first commit ad9f838
There's a second commit (606e727) that introduces a test helper which I think is very useful but can also be removed/moved to another PR.
Thank you for hex 💚 Also, happy for any feedback on code etc. :)