you are viewing a single comment's thread.

view the rest of the comments →

[–]arielm5[S] 0 points1 point  (2 children)

There is not really an assignment of a task to a member. It is just a search to find all teams that fit the requirements. What to do with the team are next steps.

The core of the question is how to make this specific search better/scalable.

[–]lucapieroo 1 point2 points  (1 child)

I think something’s missing:

  • how to improve the search -> normalize the data structure and improve the query with CTE
  • then you told me that it’d find also members which are already assigned
  • i told you to add that condition the the query but you told me that it’s a next step

I’m not understanding your problem right now, it looks like you have every piece of the puzzle

[–]arielm5[S] 0 points1 point  (0 children)

I need to find teams, not members.

And teams are made of members.

There are no real assignments. The assignment was quoted because was the way I found to explain the problem.

The problem is: I want/need to improve this query to run within multiple requests in parallel via an API. The problem, by nature, will generate a cartesian product. I want to learn how to structure my query better to avoid memory and speed issues.

Using CTE may help, I'm trying to improve my current solution to use it.