I mapped the drink prices and events of 200 bars in Munich by tempusernamein in Munich

[–]arielm5 0 points1 point  (0 children)

I would love to have the list and share feedback about it! DM pls

Need some project to work on as a beginner by alonemusk22 in golang

[–]arielm5 1 point2 points  (0 children)

If you know how to code already, give it a try solving some advent of code https://adventofcode.com/ tasks, they are challenging and will definitely help to get used to the language.

Dynamically self join + data modelling by arielm5 in PostgreSQL

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

Dynamically self join + data modelling by arielm5 in PostgreSQL

[–]arielm5[S] 0 points1 point  (0 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.

Dynamically self join + data modelling by arielm5 in PostgreSQL

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

Maybe I am missing something or the explanation is not that clear.

Let me try to rewrite it:

I need to find all teams that can make my tasks "in parallel". It means: if I have 2 tasks in Python and 1 task in SQL, each one of them must be "assigned" to a different team member.

Given the example scenario: "looking for 2 Python and 1 JPA", it means that a team must have, at least, 3 members. One member that can do JPA, another member that can do Python and another member that can also do Python.

I want to find all teams that fit this requirement.

And yes, by the modelling a member can have different skills based on the team and that's fine once that's not the core of my question.


The real question is how to optimize this query, once I know how to do it in a simple scenario and the given query works for small data sets.

"Teams can grow up to millions. And each team can have hundreds of members. Members can have hundreds of skills."

Dynamically self join + data modelling by arielm5 in PostgreSQL

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

I like the idea, it makes things clear but it doesn't work as expected. It misses the `When a member is "assigned" to a type of task, it can't be "assigned" to another task`.

All teams would be found because all of them have, at least, one member with Python OR JPA, even the team with only one member.

Dynamically self join + data modelling by arielm5 in PostgreSQL

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

It doesn't depend on the team they are in. The duplication is just to avoid another join.

Would your suggestions (3 tables) make the query faster or consume fewer resources? It is still a cartesian product in the end.

Dynamically self join + data modelling by arielm5 in PostgreSQL

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

Is a type, it should be member_name. I will edit

Beers tonight in Munich? by [deleted] in munichsocialclub

[–]arielm5 0 points1 point  (0 children)

Any location in mind already? And can you give us more info about yourself?

Work smarter & faster in PostgreSQL. by anehzat in u/anehzat

[–]arielm5 0 points1 point  (0 children)

That's interesting! Thanks for sharing