Is anyone familiar with Percona PMM install?

|
piterden 2021-11-28 21:57:23
Peter Hans 2021-11-28 21:56:58
I understand. I posted a code snippet above to show what I have done so far. But it is wrong. So I thought I might get a hint or help for what I have fiddled out wrong.

Wrong DB structure

Peter Hans 2021-11-28 21:57:37
ok
Peter Hans 2021-11-28 21:57:46
thank you very much for your time and effort.
Peter Hans 2021-11-28 21:57:56
I will try to solve it somehow
MasterZiv 2021-11-29 05:44:56
Peter Hans 2021-11-28 21:23:36
I have a table with states and their population for certain years. Now I have to query 10 of the states with the biggest population growth for the year 1990. I have no clue how to achieve it.

Filter on year 1990 and Self join on same table filtered by year 1989, calculate population difference for the city, order by this value, descending, and limit to 10 rows.

(I confused cities with States but idea is same)

MasterZiv 2021-11-29 05:47:22
Peter Hans 2021-11-28 21:36:44
CREATE TABLE Laender (
Kuerzel char(2) NOT NULL,
Hauptstadt_sid int DEFAULT NULL,
Name varchar(100) NOT NULL,
Einwohner_1960 int DEFAULT NULL,
Einwohner_1970 int DEFAULT NULL,
Einwohner_1980 int DEFAULT NULL,
Einwohner_1990 int DEFAULT NULL,
Einwohner_2000 int DEFAULT NULL,
Einwohner_2010 int DEFAULT NULL,
Einwohner_2015 int DEFAULT NULL,
Einwohner_2019 int DEFAULT NULL,
Flaeche int DEFAULT NULL,
Beitritt int DEFAULT NULL,
Stimmen int DEFAULT NULL,
PRIMARY KEY (Kuerzel),
KEY Hauptstadt_sid (Hauptstadt_sid),
CONSTRAINT laender_ibfk_1 FOREIGN KEY (Hauptstadt_sid) REFERENCES Staedte (sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

What is this non relational shit?

MasterZiv 2021-11-29 05:49:37
Peter Hans 2021-11-28 21:36:44
CREATE TABLE Laender (
Kuerzel char(2) NOT NULL,
Hauptstadt_sid int DEFAULT NULL,
Name varchar(100) NOT NULL,
Einwohner_1960 int DEFAULT NULL,
Einwohner_1970 int DEFAULT NULL,
Einwohner_1980 int DEFAULT NULL,
Einwohner_1990 int DEFAULT NULL,
Einwohner_2000 int DEFAULT NULL,
Einwohner_2010 int DEFAULT NULL,
Einwohner_2015 int DEFAULT NULL,
Einwohner_2019 int DEFAULT NULL,
Flaeche int DEFAULT NULL,
Beitritt int DEFAULT NULL,
Stimmen int DEFAULT NULL,
PRIMARY KEY (Kuerzel),
KEY Hauptstadt_sid (Hauptstadt_sid),
CONSTRAINT laender_ibfk_1 FOREIGN KEY (Hauptstadt_sid) REFERENCES Staedte (sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

This must be split into two tables, this is not 1st normal form even

MasterZiv 2021-11-29 05:55:59
Peter Hans 2021-11-28 21:42:05
I might explain my problem. I can do aggregation in a simple way. However I never had to calculate growth over a period. I is a task to practice for the exams. the prof has never showed us the way how to do it. And on internet I don’t find any useful links that explain how to do such queries.

Over a period you can’t calculate growth as you don’t have data needed, you have only 10year difference.

Just substruct two years and you’ll have population growth.

Select
Einwohner_1990 – Einwohner_1980 as pop_growth_last10y

MasterZiv 2021-11-29 05:57:29
MasterZiv 2021-11-29 05:55:59
Over a period you can’t calculate growth as you don’t have data needed, you have only 10year difference.

Just substruct two years and you’ll have population growth.

Select
Einwohner_1990 – Einwohner_1980 as pop_growth_last10y

This table should not be even considered as an example this is non relational structure

Liran 2021-11-29 12:16:06
is anyone familiar with Percona PMM install?
svart 2021-11-29 17:01:07
Liran 2021-11-29 12:16:06
is anyone familiar with Percona PMM install?

Percona provides decent documentation how to install pmm. Your favourite search engine will find it for you

alekiwi2 2021-11-29 17:14:25
Hi everyone , does anyone know if null values grab more space than varchar (255) in a column that is already settled as varchar(255) ?
alekiwi2 2021-11-29 17:15:14
I’m keeping some dates and I want to know if would be better to have ‘0000-00-00 00:00:00’ values or null values
piterden 2021-11-29 17:16:28
alekiwi2 2021-11-29 17:15:14
I’m keeping some dates and I want to know if would be better to have ‘0000-00-00 00:00:00’ values or null values

How do you think, what is the null values main purpose?

Liran 2021-11-29 17:18:10
svart 2021-11-29 17:01:07
Percona provides decent documentation how to install pmm. Your favourite search engine will find it for you

Thanks but that’s not helping

piterden 2021-11-29 17:19:28
Liran 2021-11-29 17:18:10
Thanks but that’s not helping

Try another engine

Liran 2021-11-29 17:22:51
piterden 2021-11-29 17:19:28
Try another engine

If you don’t help don’t bother replying.

piterden 2021-11-29 17:54:30
Liran 2021-11-29 17:22:51
If you don’t help don’t bother replying.

If you want to get help describe your problem detailed. Just asking like who wants to help me will never give you the result

piterden 2021-11-29 17:57:57
Liran 2021-11-29 17:22:51
If you don’t help don’t bother replying.

The same if something is not helping you, you should tell exactly what. Your previous messages is just a flood

MasterZiv 2021-11-29 17:58:16
alekiwi2 2021-11-29 17:14:25
Hi everyone , does anyone know if null values grab more space than varchar (255) in a column that is already settled as varchar(255) ?

No null values don’t take space at all. But you must have stated your DB storage engine, I’m answering about InnoDB.

MasterZiv 2021-11-29 17:59:24
alekiwi2 2021-11-29 17:15:14
I’m keeping some dates and I want to know if would be better to have ‘0000-00-00 00:00:00’ values or null values

‘0000-00-00 00:00:00’ is just an invalid datetime value, not all installations of MySQL allow it

Liran 2021-11-29 18:01:04
How can I view the connection log / audit log with Percona PMM? I connected the tool to a mySQL running on GCP
Peter Hans 2021-11-29 19:13:10
MasterZiv 2021-11-29 05:57:29
This table should not be even considered as an example this is non relational structure

Thank you very much for your help. Actually it is a relational structure. There are more tables in the task which are related to each other with foreign keys and so on. I only showed this table because only this table contains the information about the states. It is not asked to normalize the table. It might come at the end of the task. It is just the first few questions that I’m working on.

MasterZiv 2021-11-29 19:13:50
Peter Hans 2021-11-29 19:13:10
Thank you very much for your help. Actually it is a relational structure. There are more tables in the task which are related to each other with foreign keys and so on. I only showed this table because only this table contains the information about the states. It is not asked to normalize the table. It might come at the end of the task. It is just the first few questions that I’m working on.

No, it is not, not even the 1st normal form!

Peter Hans 2021-11-29 19:14:29
MasterZiv 2021-11-29 19:13:50
No, it is not, not even the 1st normal form!

Ahh you mean from that perspective. Yes you are right. It is not.

PrasanjitPattanaik 2021-11-29 20:04:51
Can any one help me out.

If I am running a cluste of Kubernetes and in that I have a node app.

How to connect that with Mysql server

While creating user in Mysql it asks for IP address.
Then which IP i should give?

I have 2 nodes in the cluster.

And it keeps on autoscaling.

MasterZiv 2021-11-29 20:06:11
PrasanjitPattanaik 2021-11-29 20:04:51
Can any one help me out.

If I am running a cluste of Kubernetes and in that I have a node app.

How to connect that with Mysql server

While creating user in Mysql it asks for IP address.
Then which IP i should give?

I have 2 nodes in the cluster.

And it keeps on autoscaling.

It is CLIENT IP address, not the address of the server (or any node)

piterden 2021-11-29 20:06:58
PrasanjitPattanaik 2021-11-29 20:04:51
Can any one help me out.

If I am running a cluste of Kubernetes and in that I have a node app.

How to connect that with Mysql server

While creating user in Mysql it asks for IP address.
Then which IP i should give?

I have 2 nodes in the cluster.

And it keeps on autoscaling.

So where is your db server run?

PrasanjitPattanaik 2021-11-29 20:08:06
What is that?

As previously I use to add server IP address.

And create a user then they were getting connected.

PrasanjitPattanaik 2021-11-29 20:09:09
piterden 2021-11-29 20:06:58
So where is your db server run?

It is a dedicated Mysql db server that is running on Digital ocean.

I have a cluster and with 2 nodes and autoscaling on I want to connect that to my Mysql server

piterden 2021-11-29 20:10:43
PrasanjitPattanaik 2021-11-29 20:09:09
It is a dedicated Mysql db server that is running on Digital ocean.

I have a cluster and with 2 nodes and autoscaling on I want to connect that to my Mysql server

Connect it to your dedicated server on DO

piterden 2021-11-29 20:10:57
Both
MasterZiv 2021-11-29 20:11:04
Because previously
When i want my app server to communicate with Mysql server.

I was creating user in Mysql server by adding the IP of the app server.

MasterZiv 2021-11-29 20:11:04
Can you please tell me morr about client IP
PrasanjitPattanaik 2021-11-29 20:11:30
MasterZiv 2021-11-29 20:11:04
Because previously
When i want my app server to communicate with Mysql server.

I was creating user in Mysql server by adding the IP of the app server.

Yes bro this is the problem

|