MySQL 5.5 brought many performance enhancements and expanded the feature set of the popular open-source RDBMS.

learn more… | top users | synonyms

2
votes
4answers
227 views

Aggregate query optimization

Could you please help me to optimize this query - currently it takes ~4 minutes to run this query. It looks like keys: ip and timestamp are non-unique so shall I add some indexes? mysql> EXPLAIN ...
0
votes
1answer
23 views

ON DELETE CASCADE pseudo delete

For data integrity ON DELETE CASCADE is necessary but it's really dangerous when a delete affects like a Chain Reaction! I know one way to prevent this is to make a pseudo delete by putting a ...
0
votes
1answer
49 views

Select post and concatenating all categories it belongs to

I have 3 DB tables POSTS +----------+----------+----------+ | id | title | content | +----------+----------+----------+ CATEGORIES +----------+----------+ | id | title | ...
1
vote
3answers
99 views

Will redirecting queries to dev/null warm up indexes?

I'm trying to warm up the buffer pool. Will running a query and re-directing the output to /dev/null suffice? e.g. mysql -u username -p -e "select id from tbl where 1=1" > /tmp/results.txt Thanks
0
votes
1answer
65 views

want to download 3GB database table from my development mysql server [duplicate]

I need to download database structure with data. Total size of the DB is more than 3GB. If i use phpmyadmin it is not working. I have also tried by increasing the execution time in php.ini. I need ...
1
vote
1answer
75 views

Master-Master Replication Duplicate Key

I have set two servers master-master replication mysql , i manage to set successfully but the problem is the duplicate key i got MASTER 1 Configuration /etc/my.cnf [mysqld] server-id=1 bind-address ...
1
vote
3answers
241 views

What happens when we take a timediff between timestamp and datetime

Say I have following table in mysql (5.5+): CREATE TABLE IF NOT EXISTS `test` ( `id` int(11) NOT NULL, `x_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, ...
-1
votes
1answer
47 views

Query to retrieve data based on several where conditions ( Not off Topic , Answer provided below is right ) [closed]

Database : Mysql 5.5 i have a table T1 containing 4 columns : No. , Height , start_time , end_time In column height i have 3 distinct values only : Small Medium High Now i ...
1
vote
1answer
56 views

Slow queries InnoDB occasionaly

I have the next table: CREATE TABLE `sessions` ( `session_id` char(32) COLLATE utf8_unicode_ci NOT NULL, `session_expires` int(11) NOT NULL DEFAULT '0', `session_data` varchar(10000) COLLATE ...
0
votes
0answers
28 views

Rails with mysql 5.5 update queries take long

app was running Rails and MySQL 5.1 and worked quite well. When we have upgrade to the new server with MySQL 5.5 some update and delete queries started to work quite long (1 sec vs 50ms on old ...
0
votes
0answers
41 views

Log-slave-updates in multi master replication using Tungsten replicator

I m setting up a system as follows with 2 masters and 2 slaves. M1 <----> M2 (Tungsten Replication) M1 ----> S1 (MySQL Replication) M1 ----> S2 (MySQL Replication) I have enabled the ...
1
vote
0answers
52 views

Refactoring IN Subquery, Avoiding Query in a Loop

I've got a table which was designed as both the current data set for participants, as well as being the historical changeset for those participants. This table has been in use for approximately three ...
1
vote
1answer
36 views

Is there a product to auto-build indexes based on slow queries?

I'm looking to either find, purchase, or write a script to identify slow queries, identify potential missing indexes, and when needed create the appropriate index within a reasonable amount of time of ...
0
votes
0answers
67 views

Create Drop Temporary Table very slow vs Truncate

I've got this stored Procedure that is called by an event that runs every 1 minute. The stored procedure selects some data from one device and puts it in a temporary table. Than it picks up other ...
0
votes
0answers
23 views

MySQL Procedure call is limiting parameters to 3 characters

I am running MySQL 5.5 using MAMP on my local machine. I have imported a database that was exported from a Windows Development environment. To get my Procs to run correctly locally, I had to change ...
0
votes
2answers
18 views

Joining on 3 different keys as they're set

I have these tables: TABLE vessels ID int PK organization_id int FK fleet_id int FK name VARCHAR TABLE settings ID int PK organization_id int NULL FK fleet_id int NULL FK vessel_id int NULL FK ...
0
votes
0answers
42 views

Upgrade from mysql 4.1 to mysql 5.5

I was going through upgrade process of mysql server. It is mentioned that to upgrade from 4.1 to 5.5 we need to upgrade step by step like first to 5.0,5.1 ...5.4 and then 5.5. I have some questions : ...
2
votes
0answers
20 views

MySQL slow query log not logging all slow queries [duplicate]

I am trying to analyze the hibernate query performance in our application. I tried logging all hibernate queries which take more than 100ms execution time from application side as well as using mysql ...
0
votes
0answers
11 views

Will performing a physical copy of a MySQL database on Windows to a MySQL instance on Linux still perform? [duplicate]

I'd was told you can copy text files and such from Windows to Linux just fine, I was wondering if I could copy my innodb files such as .ibd and .frm files to a mysql instance running on Linux, fire it ...
0
votes
0answers
18 views

How are performances with InnoDB auto-extending data file

Our innoDB tablespace is configured like this: innodb_data_file_path = ibdata00:40G;ibdata01:40G;ibdata02:100M:autoextend If I take a look to the directory: [root@xxx innodb]$ du -hs ...
0
votes
0answers
31 views

stress testing mysql - maximizing qps for a single user

I am running a stress test and I am trying to churn out as much qps as I can for a single user. I know this is a loaded question so I will try to be more specific. Trying to target 30,000 qps with a ...
1
vote
1answer
34 views

Will composite indexes or unique indexes help with query performance?

I need help with identifying indexes to increase performance of the following query. I'm currently using v5.5 with InnoDB. I cannot modify the query. However, I can add indexes as needed. The ...
0
votes
1answer
2k views

Error “#1118 - row size too large” on the first row of the table only

I ran into a problem using a mySQL database. I have some columns as type text but when I try to enter data into the first row I get the error code "#1118 - Row size too large. The maximum row size for ...
0
votes
0answers
18 views

How can I determine the performance (rows/second) for a certain query on one of my tables?

I want to find the performance (rows/second) for an UPDATE query on one of my tables so I can adjust my WHERE clause to select an appropriate number of records. The table has around 10 million rows. ...
1
vote
1answer
51 views

How can I make multiple joins on the same table?

I have a table (signal) which contains references to two other tables (ee and eeav). I want to perform an SQL Query which combines the data from ee and eeav tables. The situation is as follows: The ...
0
votes
0answers
17 views

How to ensure accents are view as different characters when adding to unique indexes?

What can I do to ensure MySQL views the following as two different values? Bee Bée When I try to create a unique index, it fails because they're the same value. I looked at the following thread, ...
0
votes
2answers
593 views

Master slave replication in mysql seconds behind master goes on increasing

In replication at slave end seconds_behind_master goes on increasing. The dump file for upload is of 6.7 gb large, can it be the reason for the lagging of seconds behind master?
1
vote
2answers
212 views

How to outer join multiple tables to retrieve uncommon records

I'm trying to do an outer join in MySQL to identify records not common to 3 tables. Here's my current effort http://sqlfiddle.com/#!2/02b92/30 I'm trying to retrieve the records not common to all ...
1
vote
1answer
28 views

Is it possible to find the user whose aggregated score reaches X value first?

Given this sample fiddle containing sales value and date for two users: http://sqlfiddle.com/#!2/8148be/3 How can I find the first user who has reached a total saleValue of 30 since the beginning of ...
0
votes
2answers
89 views

Buffer pool above 90% utilized causes MySQL to crash

Without getting deep into the architecture and setup, is it common behavior for MySQL to act in this manner? EDIT I'm using Rolando's script to identify how full the innodb_buffer_pool is. SELECT ...
0
votes
1answer
46 views

Is there a way to truncate the microseconds of a CSV value when importing data using LOAD DATA INFILE?

I'm loading data using LOAD DATA INFILE in 5.5 where the value includes microseconds. I must use DATETIME data type. Currently, I'm using regular expressions to remove them from the CSV prior to ...
0
votes
0answers
11 views

How to recover from a corrupt relay file on a slave?

I recently had a master shutdown on its own. In this case, the slaves all recovered fine. However, I starting thinking about how to recover if the master shuts down and for some reason the relay log ...
1
vote
1answer
82 views

database design for dynamic menu bar [closed]

I am trying to create a menu bar which will load dynamically on user log in, based on the user roles. Say if the user is an admin he can see all the items listed under the header and if a user is a ...
0
votes
0answers
25 views

How to return nothing but the number of rows and execution time?

I'm trying grab the # of returned rows and execution time rather than the actual records. Or,at the very least discard the results. Any tricks to do this? I could use outfile or SP and then parse it, ...
0
votes
1answer
154 views

How to resolve “Error log file size is increasing in mysql 5.5” issue w/o restarting mysql

I have an Ubuntu server with MySQL 5.5 installed. In /var/lib/mysql a .err file is kept on updating with these warnings only: [Warning] IP address '234.22.11.221' could not be resolved: Temporary ...
0
votes
0answers
47 views

How to decrease load time by chunking large file using Percona pt-fifo-split?

I'm loading data into a fresh instance which takes ~48s to load a single file (1G; 2.5m rows). To decrease load time, I tried chunking it into 100k rows using Percona's pt-fifo-split. Unfortunately, ...
0
votes
1answer
132 views

How should I config the my.ini(or my.cnf) file for mysql?

Thanks for taking your time to look at my question, and I hope that you can help me with this. I have a Windows Server 2012 server, it has: Memory : 3840MB Ram Processor: Intel(R) Xeon(R) CPU ...
0
votes
1answer
37 views

Will MySQL redirect a read request to the master after a certain time? [closed]

I can't find what variable controls this or any information about the time limit. Thanks!
1
vote
1answer
51 views

How to find the length of multiple column index in MySQL

Is there a way to find out what is the length in bytes for the unique index (NKU) key created through the following command: CREATE TABLE test_ ( testId bigint(20) NOT NULL, name varchar(75) ...
2
votes
2answers
607 views

MySQL COUNT Query taking too long time to execute

I have below query that takes 7 secs to run SELECT COUNT(*) AS `count` FROM `yuldi`.`businesses` AS `Business` LEFT JOIN `yuldi`.`businesses_categories` AS `BusinessesCategory` ON ...
1
vote
1answer
185 views

Mysql 5.5 InnoDB growing CPU - Going crazy

Good morning, I'm currently facing a problem where CPU usage keeps going up until the server crash. I've tried multiple best practices proposed in this forum and on Percona, reinstalled the server ...
1
vote
2answers
68 views

Nested query efficiency in MySQL

I have a table with several attributes like this: id id2 attribute -------------------------------- 1 100 blue 2 100 red 3 100 green 4 100 white 5 102 blue 6 102 green 7 102 ...
1
vote
2answers
41 views

Are relay logs necessary for replication?

I'm trying to understand when/where using relay log is beneficial. According the documentation, mysql captures and writes events from the master's binary log as the result of the I/O thread. Then, the ...
0
votes
0answers
15 views

How is the key length determine in an index?

Aside from explicitly setting the key length when creating an index, how does MySQL determine the appropriate key len shown when running "explain"? Thanks
1
vote
1answer
22 views

Is there any value in adding an already indexed column to a composite index?

The title says it all. Does the query optimizer see composite indexes where each column is already indexed as redundant? Or, is it used when each of the composite index's columns are in the WHERE ...
0
votes
0answers
12 views

Is there any value in adding a pk column to an composite index? [duplicate]

I recently inherited a database with indexes that contain the table's primary key as part of some composite indexes. Given MySQL adds a hidden column representing the PK regardless of whether you ...
1
vote
1answer
48 views

Migrating MyISAM tables from 5.5 => 5.6

I was wondering if anyone had any pointers on migrating MyIASM tables from mysql 5.5 to 5.6, specifically using Percona builds, via an rsync? Is this safe? I know we need to do a full ...
1
vote
2answers
47 views

How can I store least used table files to a slower drive?

Is it possible to separate the least used and most frequently used data files on to separate disks when using InnoDB?
1
vote
1answer
23 views

How to decipher the transaction message in innodb status log.

I have several transactions that seem have stalled. Looking at the innodb status log, I found several messages similar to the following: ---TRANSACTION 69DBBB, ACTIVE 947 sec starting index read, ...
1
vote
1answer
52 views

How to store temp tables in memory during table “optimize”?

When optimizing tables, SHOW PROCESSLIST lists it as "copying to tmp table". I'm trying to ensure the copy takes place in memory to speed up the process. I've tried adjusting the tmp_table_size to ...