mariasql

Should I turn off Query Cache in MySQL?

核能气质少年 提交于 2021-02-10 15:12:59
问题 I'm using a dedicated server with 32GB RAM and an 8-core server, using Maria DB 10.1 and most tables are InnoDB. Total DB size is less than 2GB but I think performance is slow. The following is the my.cnf file I'm using: [mysqld] log-error=/home/MySQL_Server/mysql/dedi.server.co.err datadir=/home/MySQL_Server/mysql pid-file=/home/MySQL_Server/mysqlmysqld.pid innodb_file_per_table=1 skip-name-resolve=1 bind-address=127.0.0.1 #skip-networking=1 #query_cache_type=0 query_cache_type=1 innodb_file

Maria db how to use groups, unions, and/or sum/count in a select query

。_饼干妹妹 提交于 2020-01-16 16:49:29
问题 I've been breaking my mind for three days trying to puzzle this one out. I'm new to Maria db and sql in general. I've managed to use UNION on a previous similar situation but it's not working in this one. I have three tables as follows: create table zipcode (zip int, city varchar(30)) create table student (id int, zip_fk int) create table teacher (id int, zip_fk int) I want to create a select query that will have the following fields: city, the number of students from the city, the number of

Maria db how to use groups, unions, and/or sum/count in a select query

倾然丶 夕夏残阳落幕 提交于 2020-01-16 16:49:28
问题 I've been breaking my mind for three days trying to puzzle this one out. I'm new to Maria db and sql in general. I've managed to use UNION on a previous similar situation but it's not working in this one. I have three tables as follows: create table zipcode (zip int, city varchar(30)) create table student (id int, zip_fk int) create table teacher (id int, zip_fk int) I want to create a select query that will have the following fields: city, the number of students from the city, the number of

How do I create procedure which does similar job of my php function (Optimization speedup)

回眸只為那壹抹淺笑 提交于 2019-12-24 23:19:28
问题 I got table like below mysql> select * from dts; +----+------+------+--------+------+------+------+------+------+ | Id | key1 | key2 | serial | pr1 | pr2 | pr3 | pr4 | pr5 | +----+------+------+--------+------+------+------+------+------+ | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 2 | | 2 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | | 3 | 1 | 1 | 3 | 0 | 0 | 0 | 1 | 0 | | 4 | 1 | 1 | 4 | 1 | 0 | 1 | 1 | 3 | | 5 | 1 | 2 | 5 | 0 | 0 | 0 | 2 | 5 | | 6 | 1 | 2 | 6 | 0 | 0 | 0 | 0 | 1 | | 7 | 1 | 2 | 7 | 0 | 1 | 0 |