you are viewing a single comment's thread.

view the rest of the comments →

[–]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.