| Showing entries 1 to 5 |
MySQL keeps many different files, some contain real data, some contain meta data. Witch ones are important? Witch can your throw away?
This is my attempt to create a quick reference of all the files used by MySQL, whats in them, what can you do if they are missing, what can you do with them.
When I was working for Dell doing Linux support my first words to a customer where “DO YOU HAVE COMPLETE AND VERIFIED BACKUP?” Make one now before you think about doing anything I suggest here.
You should always try to manage your data through a MySQL client. If things have gone very bad this may not be possible. MySQL may not start. If your file system get corrupt you may have missing files. Sometimes people create other files in the MySQL directory (BAD). This should help you understand what is safe to remove.
Before you try to work with one of
[Read more...]Your searching for how to create a join across two databases on two different servers and it can’t be done directly. select d1.a, d2.b from db1@server1 join db2@server2 where db1.c = db2.c; does not work.
You learn about federated databases. The federated storage engine allows accesses data in tables of remote databases. Now how do you make it work?
1) Check if the federated storage engine is supported. Federation is OFF by default!
mysql> show engines; +------------+---------+----------------------------------------------------------------+ | Engine | Support | Comment | +------------+---------+----------------------------------------------------------------+ | InnoDB | YES[Read more...]
Do you have MyISAM tables you reload with new data?
Do your queries, using that table, get blocked because the table is locked?
Do the waiting queries create idle connections slowing down the table load?
Do you wish you could just replace the table?
Years ago I was told you can replace CSV tables by simply replacing the CSV file. I figured this would also be true of a MyISAM file and it is. I use this perl script to replace MyISAM tables forcast and current observation weather data. The processing and tables are created on another computer. Weather forecasting is CPU and database expensive. I then copy (rsync) the files to the production system and run this script.
#!/usr/bin/perl ################################################################################[Read more...]
I guess many of you know, that using SELECT count(*) FROM table is problematic and slow when using Innodb tables.
This actually only applies to COUNT(*) queries without WHERE a clause as mentioned in the MySQL Performance Blog.
But if you got some slow count query in your application the best way to increase its performance is to replace / remove it.
So if you are going do to "SELECT count(*) FROM products" the best way, is to have a separated table
that stores the number of products. If you're inserting a row increment the counter, if you're deleting a row, decrement it.
Here is some example:
CREATE TABLE counter( number_of_products int(10) DEFAULT '0' NOT NULL);
Increment when you're adding a new product to the products table:
[Read more...]| Showing entries 1 to 5 |