FAQ Database Discussion Community


mysql execution plan explanation

mysql,sql,query-execution-plans,mysql-5.5
There is following query select count(*) from my_table my_t where my_t.c1 = '3' and my_t.c2 = '123' This table has index on (c1, c2) and both these columns have not null constraint. Its execution plan: # id, select_type, table, type, possible_keys, key, key_len, ref, rows, Extra 1, SIMPLE, my_t, ref,...

Too much time on optimal path

mysql,mysql5,mysql-5.5
Below query has taken just 0.04 second SELECT A.* FROM `TABLE1` JOIN TABLE2 ON ( TABLE1.ID = TABLE2.ID ) WHERE `COL1` ='1' While next query has taken 4 seconds SELECT A.* FROM `TABLE1` JOIN TABLE2 ON ( TABLE1.ID = TABLE2.ID ) WHERE `COL1` ='1' and col2 not in (....ard 4k...

How to install mysql 5.6 in ubuntu 12.04

mysql,ubuntu-12.04,upgrade,mysql-5.6,mysql-5.5
I was needed to upgrade mysql 5.5 to 5.6, to avoid some issues on importing sql files. ERROR 1293 (HY000) at line 231: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause How do you upgrade it?...

How to enable MySQL query log in “Server version: 5.5.40-0ubuntu0.14.04.1 - (Ubuntu)” on to server?

mysql,logging,mysql-5.5
I'm using MySQL database server ("Server version: 5.5.40-0ubuntu0.14.04.1 - (Ubuntu)") using phpMyAdmin. I'm using PHP as a server-side language which communicates with the database by means of SQL queries. I want to add the log of all the queries that are basically called from the PHP code. I did lot...