How to use joins correctly #350
Replies: 4 comments 9 replies
-
Hi @KantorSerhiy , On 100K input data the final query runs in 198ms for me:
Is this what you observe too? Do you consider this slow? :-) How big is you data? And thank you for your kind words! |
Beta Was this translation helpful? Give feedback.
-
I might be stating the obvious; but the performance of joins depends heavily on how indexes are set up (I once was asked to fix a performance problem on a MySQL database and, after I did a few "EXPLAIN" commands and "CREATE INDEX" commands, an overloaded server became a server that was sleeping most of the time). |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's a great point, @kamahen ! I've updated the CoLab to run on Postgres and use 5M rows. Here are new times:
Are they inline with what you see? |
Beta Was this translation helpful? Give feedback.
-
@EvgSkv I managed to roughly reproduce it)) I'm not sure what you can see in colab, so I'll duplicate it here again.
Yes, I apologize for its quality, for these names of predicates, but I think everything should be clear here. I think (I'm not 100% sure) that the problem is in this sql ->
because you can see that he is trying to pull out the same table in the same place. In the collab, it happens relatively quickly, but the real data in the table is much larger and slightly different=) |
Beta Was this translation helpful? Give feedback.
-
hey @EvgSkv !
how are you?
I have a question for you about logicа, and I hope you can help me.
for example, I have the following logica code -->
which generates the following sql ->
(this is a very simple example.)
On relatively small data, it works well.
But when there is a lot of data, sql takes a long time to execute.
As far as I understand, the logica does not support the direct use of joins.
Perhaps you can suggest how to get around this nicely (I mean joins) and optimise the logica code for more efficient use?
P.S.
Logica is amazing, I get excited every time I use it=)
Beta Was this translation helpful? Give feedback.
All reactions