Showing entries 1 to 30 of 28095 | Next 30 Older Entries |
Did you just run an UPDATE against your 10 million row users table without a WHERE clause? Did you know that in MySQL 5.5 that sometimes you can recover from a bad UPDATE statement? This is possible if you are running in binlog_format=ROW !
Imagine this scenario:
CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, `c2` varchar(10) NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB; INSERT INTO `t1` (`c2`) VALUES ('michael'), ('peter'), ('aamina');
We run an accidental UPDATE statement that changes a row:
UPDATE `t1` SET `c2` = 'tom' WHERE `c1` = 2;
If we examine this UPDATE using the Binary Logging format of STATEMENT the entry would look like:
# at 464 #121019 16:10:42 server id 1 end_log_pos 532 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1350677442/*!*/; BEGIN /*!*/; # at 532[Read more...]
Percona has offered Training for years, and I have personally delivered my share of Public and Private training. Below are my thoughts on the different training delivery options and how to choose the one that fits your needs.
The Onsite Public training is perhaps the most conventional type. We get people from different people and go over our standard curriculum for the class This is often the best choice when sending 1-2 employees, as they will likely establish connections with other students and benefit from their respective questions and comments – This provides great insight and a much better learning experience. Joining an Onsite Public course is also more affordable than Private Training too. There are, however, downsides – one being its set curriculum.
[Read more...]Some of our users have faced the situation when they need to change the connection details of the existing Database Diagram file.
Let’s assume the situation when you have several databases with identical schemas which are only located on different MySQL servers and you have created a database model that was saved in a Database Diagram file. Now, you want to avoid redesigning the database model from scratch and only reassign the existing database model to another MySQL server.
Here are some steps you can follow to achieve this:
1. Create a database diagram.
2. Arrange objects on the diagram so you can easily read them (create containers, notes, etc).
3. Save the diagram and close dbForge Studio for MySQL.
4. Open the Database
[Read more...]The MySQL Windows Experience Team is proud to announce the release of MySQL for Excel version 1.1.0 GA, one of our newest products contained in the MySQL Installer suite. This new version introduces the Edit MySQL Data feature.
You can download it from our official Downloads page at http://dev.mysql.com/downloads/installer/.
It has been several weeks since the last time I did a DB roundup, mostly due to travel. I spoke at Nagios World Conference 2012 at the end of September in St. Paul, Minneapolis, and then had a keynote and 2 talks at MySQL Connect, which was followed by Oracle OpenWorld and a Web Operations Team Meetup, which the DB team was invited to participate (and since I was in San Francisco anyway, I figured I’d stay for the meetup and the millionaire’s bacon (it was epic).
We have been busy, and getting some great and
Here at End Point we strongly encourage the use of PostgreSQL. The reasons are numerous, but I'd like to highlight one today. MySQL's support for case sensitive search is explained somewhat opaquely in the aptly titled Case Sensitivity in String Searches documentation. In short, it explains that by default, MySQL won't treat strings as case sensitive when executing a statement as such:
SELECT first_name FROM contacts WHERE first_name REGEXP '^[a-z]';
This simple search to look for contacts whose first name starts with a lower case letter, will return *all* contacts because in the default character set used by MySQL (latin1), upper and lower case letters share the same "sort value".
UPDATE: After many helpful comments from
[Read more...]Continuing my experiments with 5.6 InnoDB online DDL, a bug which I've opened, and another which I commented on were quickly answered and explained by the Oracle/MySQL team.
On both accounts I'm happy to acknowledge the issue is resolved; in both cases I failed to produce a real bug scenario. Good lesson. Kudos for quick and informative responses!
What's left of my experiment, then? Still a lot to check.
I am mainly still confused with which operations exactly can use LOCK=NONE (allowing for updated to table while ALTERing). So far I am only able to produce ALTERs with LOCK=SHARED, meaning table is readable, but cannot be updated.
I will want to test
[Read more...]Next week I’ll be visiting Moscow to talk at Highload++. The conference will take place during Monday 22nd and Tuesday 23rd at the Radisson hotel. I will be giving my personal version of an indexing talk that my colleagues have given in meetups and conferences in the US.
Highload++ conference is targeted to address the issues of complex high traffic web properties. Most of these sites depend on databases to deliver their content, record the traffic and report the application activities in real time. As I learned early in my career at MySQL, the database schema and in particular the indexing strategy, are critical to achieve the highest possible performance out of the
[Read more...]MySQL 5.6 offers the groundbreaking online DDL operations for InnoDB. Most common use cases will enjoy this feature, and the need for online alter table scripts will decrease. This is a killer feature!
I've put this new feature to the usability test. How did it go? Not too well, I'm afraid.
[Updates to this text inline], also see this followup.
sakila is still a very useful database. I say "still" because it is not very large, and computing power is getting stronger; yet on my laptop some operations can still take many seconds to
[Read more...]
[root@mysql-master python]# ./mysqlfailover --help
Usage: mysqlfailover --master=roo@localhost --discover-slaves-login=root --candidates=root@host123:3306,root@host456:3306
mysqlfailover - automatic replication health monitoring and failover
....
--candidates=CANDIDATES
connection information for candidate slave servers for
[Read more...]
Bradley Kuszmaul of TokuDB fame pointed out that my benchmark for Green Mutexes used usleep to implement lock hold times of a few microseconds and that usleep(1) would sleep for much more than 1 microsecond. So I changed the test code to use gettimeofday to implement the lock hold time and repeated the tests.
There are a few differences with the new results. First, the lock hold time is now accurate when less than 50 microseconds. Second, the thread that holds the lock uses the CPU while waiting to unlock so CPU utilization should
[Read more...]It's the time of the year again: You have 2 more weeks to submit a great proposal to the biggest and baddest MySQL Conference: Percona Live MySQL Conference and Expo 2013 (Santa Clara). Like many things in the MySQL community, this conference has also gone through a transformation over the past 3 years. But last year the growing pains and uncertainty ended with Percona putting up a great show. Attendance was up again (over 1000) and there was a sense of energy and excitement for the future of MySQL. If you are like me and like to dwell in nostalgia (so that you can get into the right mood for submitting great proposals) my coverage of last year's conference is found here: part 1,
[Read more...]The other day I needed to run a simple mysql job to backup and delete some database records on a live server. Being a live server, it is important to make sure you aren't asking the database to take on jobs that could potentially lock it up. Better to run a batch job. Running a batch is simple. You can call it right from the mysql console with:
source [path_to]/[the_batch_script].sql
But what if there are millions of records that need deleting? Bash shell script to the rescue.
Here is the idea of the SQL job that needed to get run a few times
START TRANSACTION; /* Find what you want to delete and put a LIMIT on your batch size */ CREATE TEMPORARY TABLE records_to_delete_temp SELECT id from `records` where ..... limit 1000; /* Creating backup table to archive spam orders */ CREATE TABLE IF NOT[Read more...]
What a relief! A few simple configuration steps gives me new hope for coping with email.
It unlikely matters to you, but it does to me: My inbox is down to zero. That is, both my two inboxes are empty. I get work email to my @skysql.com address and private email to my @arno.fi, both of which have been suffering from bad email habits.
Inspired by years of discussions with Giuseppe Maxia, who is living proof that proper IT tools make geeks work smarter, faster and better, I bought the book "lifehacker". The first one out of over 100 hacks is labeled "Empty Your Inbox (and Keep It
I’ll be presenting “MongoDB and Fractal Tree Indexes” at MongoDB Boston 2012 on October 24th. My presentation covers the basics of B-trees and Fractal Tree Indexes, the benchmarks we’ve run so far, and the development road map going forward.
I’ve been to this one day conference twice now and both times came away with a better understanding of MongoDB’s capabilities, use-cases, and many questions answered via their deep technical dives. I highly recommend current MongoDB users and anyone considering a MongoDB project attend – it appears that seats are still available.
It is almost an everyday task for developers to ensure the schema are in sync in their test/development/production databases. No doubt that everyone who works with MySQL servers will encounter situations where schema should be synchronized. When this happens, there must be a reliable solution where it should work in any complex situation.
You have made numerous MySQL schema changes to your databases during development of a new feature. Now you want to sync development and production schemas so that they match when you
[Read more...]InnoDB implements a mutex and rw-lock using pthread synchronization objects when compiled for Linux. These add a great feature -- SHOW INNODB STATUS is able to list the objects and locations where threads are blocked. Unfortunately this comes at a price. The InnoDB mutex uses much more CPU than a pthread mutex for workloads with mutex contention. Feature request 52806 is open for this but the feature request description is vague.
How much more CPU does it use?
I extracted all of the code needed to use an InnoDB mutex into a standalone file. This includes much of the sync array code. I then added benchmark functions that do the following in a loop: lock the mutex, increment a counter, sleep for a configurable amount of time and then
[Read more...]Do you ever find yourself wanting to open several terminal windows and send the same commands to all of them? I’ve had this need many times, and I’ve never found a completely satisfactory solution. I’ve also known a lot of people who’ve written various sets of scripts to help them accomplish such tasks.
In no particular order, here are a few ways I’ve done this in the past:
while read cmd; do screen -X at remote# stuff "$cmd"; done
The call for papers for Percona Live: MySQL Conference and Expo 2013 has been extended through October 31st. The conference will be held in Santa Clara, California from Monday, April 22nd through Thursday April 25th (and this year it’s not during Passover!).
Why You Should Submit
Percona Live is a meeting of the minds – not just the April Santa Clara conference, but all the Percona Live conferences. If you get a proposal accepted, you get free admission to the conference!
There is no cost to submit, and you do not have to tell anyone you submitted. I have submitted to conferences and been rejected – it stinks. But there is no reason not to submit. Submit a few presentations on different topics, because the presentation you have in mind might be submitted by
I'm honored to accept the role of conference chairman in the upcoming Percona Live MySQL Conference and Expo, April 22th-25th, 2013, Santa Clara, CA. Here are a few administrative announcements:
Call for papers is extended until Oct 31st. We've already received a good number of submissions, but wish to provide with another chance for latecomers. Now is a good time to submit!
The committee will begin the long reviewing process shortly.
Members of the reviewing committee are:
When your backup script is running for too long it sometimes causes the second backup script starting at the time when previous backup is still running. This increasing pressure on the database, makes server slower, could start chain of backup processes and in some cases may break backup integrity.
Simplest solution is to avoid this undesired situation by adding locking to your backup script and prevent script to start second time when it’s already running.
Here is working sample. You will need to replace “sleep 10″ string with actual backup script call:
#!/bin/bash LOCK_NAME="/tmp/my.lock" if [[ -e $LOCK_NAME ]] ; then echo "re-entry, exiting" exit 1 fi ### Placing lock file touch $LOCK_NAME echo -n "Started..." ### Performing required work[Read more...]
Showing entries 1 to 30 of 28095 | Next 30 Older Entries |