-
Hello,
Basically I have a table of objects and a table of attributes associated with those objects. And given a list of any number of attributes, I want to return the objects that include all of them. Currently this works, but only because I forced the sizes of attribute_id_list and name_list to match, (otherwise I would just get all objects). This solution, however, is very slow on large tables, and it seems like there should be a more elegant and efficient way to do it. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @martirm ! Generally unions are easier for machines compute than overlaps, so if performance is a concern, then trying to express logic via unions may be a way to go. Here is my shot at this problem with the goal to keep complexity under control: Would you like to try applying it to your data and let me know if it's performant enough? Thank you! |
Beta Was this translation helpful? Give feedback.
Hello @martirm !
This is an interesting question.
As I started implementing it I hit duckdb bug and filed an issue.
So I'm adjusting the query to avoid the bug.
Generally unions are easier for machines compute than overlaps, so if performance is a concern, then trying to express logic via unions may be a way to go.
Here is my shot at this problem with the goal to keep complexity under control:
https://colab.research.google.com/drive/1DaHmaC1yu6LaRuYrUtwH7fQzHOvmcV9X?usp=sharing
Would you like to try applying it to your data and let me know if it's performant enough?
Thank you!
Evgeny.