Timeline for MySQL: Select two values of two columns and compared their values exchanging them each other
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 15, 2016 at 17:25 | comment | added | ypercubeᵀᴹ |
I have updated the answer with useful indexes to add. Without any indexes on subscriber and leader, it's no wonder that the query is slow. Also, you don't need that UNIQUE id index. The PRIMARY KEY is identical.
|
|
Mar 15, 2016 at 17:07 | comment | added | NineCattoRules | Ok, I just updated the question | |
Mar 15, 2016 at 16:53 | comment | added | ypercubeᵀᴹ |
Can you edit the question and add the output of SHOW CREATE TABLE relations; ? How big is the table?
|
|
Mar 15, 2016 at 16:52 | history | edited | ypercubeᵀᴹ | CC BY-SA 3.0 |
added 1 character in body
|
Mar 15, 2016 at 16:50 | comment | added | NineCattoRules | I cannot use it, this SQL takes too long time to execute | |
Dec 7, 2015 at 22:04 | vote | accept | NineCattoRules | ||
Dec 7, 2015 at 19:58 | history | answered | ypercubeᵀᴹ | CC BY-SA 3.0 |