Do any one have a good hands-on of Mysql Cluster integration?

|
piterden 2021-10-24 08:59:40
Gakume Hyoma 2021-10-24 08:58:59

Look, we don’t help to lazy students

piterden 2021-10-24 08:59:52
Get it yourself
Gakume Hyoma 2021-10-24 09:00:50
piterden 2021-10-24 08:59:40
Look, we don’t help to lazy students

At least call me stupid, not lazy. I am not asking questions without giving it a try first.

piterden 2021-10-24 09:01:41
Gakume Hyoma 2021-10-24 09:00:50
At least call me stupid, not lazy. I am not asking questions without giving it a try first.

Try second time

MasterZiv 2021-10-24 09:02:12
Gakume Hyoma 2021-10-24 07:47:21
I am learning MySQL right now. At this step, I need to remove the duplicates shown in the result below, where the pair of AID and BID is the same except they swap position. Could someone enlighten me on this? Thank you

Also, very important thing : you SHOULD NEVER mix in one query ANSI joins with non-ANSI joins.

Ideally, non-ANSI joins should not be used at all, never.

ANSI join is one introduced with JOIN keyword.

Non-ANSI join is one in the form
TABLE , TABLE … WHERE … join condition

MasterZiv 2021-10-24 09:04:35
Gakume Hyoma 2021-10-24 07:47:21
I am learning MySQL right now. At this step, I need to remove the duplicates shown in the result below, where the pair of AID and BID is the same except they swap position. Could someone enlighten me on this? Thank you

And please nerver post pictures.
Send code as text. This way one can copy it and correct. Pictures are dead piece of bits.

Gakume Hyoma 2021-10-24 09:06:32
MasterZiv 2021-10-24 09:04:35
And please nerver post pictures.
Send code as text. This way one can copy it and correct. Pictures are dead piece of bits.

Okay, I was trying to show the result table at the same time. I will separate them next time.

MasterZiv 2021-10-24 09:10:54
Gakume Hyoma 2021-10-24 08:58:59

I would say this task is not complete, try once more.

Remove non-ANSI. Make the query plain, remove subqueries as much as possible. Don’t use subqueries in FROM.

And present good, accurate, logical query using mainly joins and where and probably a subquery in WHERE clause.

Gakume Hyoma 2021-10-24 09:11:27
MasterZiv 2021-10-24 09:10:54
I would say this task is not complete, try once more.

Remove non-ANSI. Make the query plain, remove subqueries as much as possible. Don’t use subqueries in FROM.

And present good, accurate, logical query using mainly joins and where and probably a subquery in WHERE clause.

Thanks for the advice

MasterZiv 2021-10-24 09:17:37
Gakume Hyoma 2021-10-24 08:58:59

Ah, this is a good task, good sample of how carthesian product happens and how to solve this problem.

If you don’t know how to remove duplicates, this will need some smart move from you, tag me in the chat I’ll tell you how this should be done, it is very simple

piterden 2021-10-24 09:19:30
MasterZiv 2021-10-24 09:17:37
Ah, this is a good task, good sample of how carthesian product happens and how to solve this problem.

If you don’t know how to remove duplicates, this will need some smart move from you, tag me in the chat I’ll tell you how this should be done, it is very simple

Don’t forget about it is googling with one query

Gakume Hyoma 2021-10-24 09:21:27
MasterZiv 2021-10-24 09:17:37
Ah, this is a good task, good sample of how carthesian product happens and how to solve this problem.

If you don’t know how to remove duplicates, this will need some smart move from you, tag me in the chat I’ll tell you how this should be done, it is very simple

I removed duplicates by only include the result when student1.ID is smaller than student2.ID. Will take a look into the carthesian product.

piterden 2021-10-24 09:22:27
Gakume Hyoma 2021-10-24 09:21:27
I removed duplicates by only include the result when student1.ID is smaller than student2.ID. Will take a look into the carthesian product.

Also there are DISTINCT and GROUP BY in your arsenal

Gakume Hyoma 2021-10-24 09:25:59
piterden 2021-10-24 09:22:27
Also there are DISTINCT and GROUP BY in your arsenal

Will give it a look, but to my knowledge, DISTINCT will not remove duplicate pairs when the two nodes of pair are in swapped, maybe it requires some advanced usage.

MasterZiv 2021-10-24 09:26:11
Gakume Hyoma 2021-10-24 09:21:27
I removed duplicates by only include the result when student1.ID is smaller than student2.ID. Will take a look into the carthesian product.

That is great because this is exactly how this should be done !

piterden 2021-10-24 09:27:29
Gakume Hyoma 2021-10-24 09:25:59
Will give it a look, but to my knowledge, DISTINCT will not remove duplicate pairs when the two nodes of pair are in swapped, maybe it requires some advanced usage.

IDK try it. GROUP BY is more configurable then DISTINCT for sure

MasterZiv 2021-10-24 09:27:32
Gakume Hyoma 2021-10-24 09:21:27
I removed duplicates by only include the result when student1.ID is smaller than student2.ID. Will take a look into the carthesian product.

No need to take a look at carthesian product as you already have done this! You have it in this query!

MasterZiv 2021-10-24 09:27:58
piterden 2021-10-24 09:22:27
Also there are DISTINCT and GROUP BY in your arsenal

Not applicable here!

MasterZiv 2021-10-24 09:28:13
Gakume Hyoma 2021-10-24 09:25:59
Will give it a look, but to my knowledge, DISTINCT will not remove duplicate pairs when the two nodes of pair are in swapped, maybe it requires some advanced usage.

Correct!

MasterZiv 2021-10-24 09:28:51
piterden 2021-10-24 09:27:29
IDK try it. GROUP BY is more configurable then DISTINCT for sure

Not needed for this query !

piterden 2021-10-24 09:29:05
MasterZiv 2021-10-24 09:28:51
Not needed for this query !

Ok, sorry. He sad he need it

Gakume Hyoma 2021-10-24 09:29:41
Thanks for the help!
S 2021-10-26 06:34:45
Hi all can any one know SQL query optimization please help me it’s an urgent
Noname Dba 2021-10-27 16:01:09
Hi everyone! I have Mariadb galera cluster which is including 3 nodes. In 3 nodes database size and rows count are small difference, however wsrep status is synthesized. How is possible? And how to solve it?
MasterZiv 2021-10-27 16:03:09
Noname Dba 2021-10-27 16:01:09
Hi everyone! I have Mariadb galera cluster which is including 3 nodes. In 3 nodes database size and rows count are small difference, however wsrep status is synthesized. How is possible? And how to solve it?

solve – reset replication node from scratch.

How – anyhow! if you let users modify data, they do

svart 2021-10-27 16:59:15
Noname Dba 2021-10-27 16:01:09
Hi everyone! I have Mariadb galera cluster which is including 3 nodes. In 3 nodes database size and rows count are small difference, however wsrep status is synthesized. How is possible? And how to solve it?

how did you find out that you nodes have discrepancy? what are the nodes state?

Noname Dba 2021-10-27 17:09:53
svart 2021-10-27 16:59:15
how did you find out that you nodes have discrepancy? what are the nodes state?

Wsrep State is synthesized. I selected db size and rows count

svart 2021-10-27 17:31:23
Noname Dba 2021-10-27 17:09:53
Wsrep State is synthesized. I selected db size and rows count

there is no such state as “synthesized”
run the following command
> mysql -e ‘show global status’ | grep state

svart 2021-10-27 17:44:18
Noname Dba 2021-10-27 17:09:53
Wsrep State is synthesized. I selected db size and rows count

when it comes to comparison of database by running select queries… it might not work well. you might difference just because you run query on the second node 0.5s later. it is not the case. galera internally has mechanism to tell you if node is synced or not. so basically you need to pay attention only to 2 things: cluster_size and node state. if state is synced then everything is fine

Noname Dba 2021-10-27 17:52:45
svart 2021-10-27 17:44:18
when it comes to comparison of database by running select queries… it might not work well. you might difference just because you run query on the second node 0.5s later. it is not the case. galera internally has mechanism to tell you if node is synced or not. so basically you need to pay attention only to 2 things: cluster_size and node state. if state is synced then everything is fine

To check db size in each nodes i stop application. Databases are not rise

Noname Dba 2021-10-27 18:35:39
svart 2021-10-27 17:31:23
there is no such state as “synthesized”
run the following command
> mysql -e ‘show global status’ | grep state

Status synchronized

Noname Dba 2021-10-27 18:36:23
Noname Dba 2021-10-27 18:35:39
Status synchronized

What is it possible?

svart 2021-10-27 20:35:50
Noname Dba 2021-10-27 18:36:23
What is it possible?

Everything is fine then. Calm down and have some beer

S 2021-10-28 09:11:30
Hi all anyone know MySQL query optimization please help me it’s paid
PrasanjitPattanaik 2021-10-29 19:09:46
Do any one have a good hands-on of Mysql Cluster integration?
|