Zahlreiche Unternehmen verlassen sich auf MySQL und PostgreSQL für die Datenverwaltung. Aber was passiert, wenn die Datenbank abstürzt oder eine Wartung benötigt? Wie können Sie sicherstellen, dass Ihre Datenbank Höchstleistung bringt mit minimalem Arbeitsaufwand für den Administrator und maximaler Auslastung der vorhandenen Hardware? Erfahren Sie, wie VNC und Continuent Tungsten Enterprise
While working through my previous blog post, rows_examined UNION Handler% ... ?!?, I
learned about some unexpected behavior of the MEMORY (HEAP)
storage engine and how it interacts with
Handler_read_rnd_next
. In particular, even a
"deleted" row (one that never really made it into the table to
begin with) still must be read over when scanning the table,
thereby incrementing Handler_read_rnd_next
when one
might not expect that to happen. I thought this would be an
interesting opportunity to use gdb to really watch what the
server was doing when this situation is encountered.
I'm far from being a gdb expert. In fact, I've probably only used it a dozen times or so. Nevertheless, I found it pretty straightforward to get things set up and to understand how to make my way around. (I've probably missed out on some shortcuts and …
[Read more]
MySQL is awesome at converting strings to integers when comparing
column lvalues with converted rvalues. So much so that many of us
take this fact for granted. When does this assumption break down?
When does passing in the wrong value cause problems in mySQL?
Let's take a table EmailLookup for example.
CREATE TABLE `EmailLookup` (
`userId` bigint(20) unsigned NOT NULL,
`email` varchar(128) NOT NULL,
`emailCrc32` int(11) unsigned NOT NULL,
`createDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`emailCrc32`,`userId`),
KEY `createDate` (`createDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
The primary key is emailCrc32, userId for a key size of 12 bytes (4 bytes for int, 8 bytes for bigint). Since this is a compound key (key with two columns), following the rules of Left Most Prefix I get two index lookup types for one. emailCrc32 and userId is a unique index lookup …
[Read more]
Welcome part four of this series of blog-posts on MongoDB, where
we previously looked at:
These were introducing some basic concept when it comes to querying MongoDB and to show some simple use cases. By now you realize that MongoDB is different from MySQL, but you probably knew that already, but why would you move from MySQL to MongoDB? Well, you know the answer to that: Performance and Scalability. If MongoDB didn't provide pretty …
[Read more]In this primer I will show how to improve the security of your MariaDB installation by using two-step verification and how to use it from your Windows GUI client.
Let’s suppose you have your data in MariaDB, installed, say, on Ubuntu. And your users connect to it to run ad hoc queries, using some sort of a Windows GUI client. You don’t want them to write the access password on post-it notes or have it auto-entered by the client. And you don’t want anyone see the password when one of the salespersons connects to the mother ship from his laptop in the Internet café. So you decide to use the two-step verification, just like Google does, to secure the access to the data.
If you don’t know what a “two-step verification” is, see, for example, this introductory video by Google.
So, 2-step verification looks great, but how …
[Read more]
I recently wrote a post about inner and outer joins, and a couple of people
asked what the difference is between USING
and
ON
.
In a nutshell, you use ON
for most things, but
USING
is a handy shorthand for the situation where
the column names are the same.
Consider this example dataset:
mysql> select * from pets; +---------+---------+--------+-----------+ | pets_id | animal | name | owners_id | +---------+---------+--------+-----------+ | 1 | fox | Rusty | 2 | | 2 | cat | Fluffy | 2 | | 3 | cat | Smudge | 3 | | 4 | cat | Toffee | 3 | | 5 | dog | Pig | 3 | | 6 | hamster | Henry | 1 | | 7 | dog | Honey | 1 | …[Read more]
I recently wrote a post about inner and outer joins, and a couple of people
asked what the difference is between USING
and
ON
.
In a nutshell, you use ON
for most things, but
USING
is a handy shorthand for the situation where
the column names are the same.
Consider this example dataset:
mysql> select * from pets; +---------+---------+--------+-----------+ | pets_id | animal | name | owners_id | +---------+---------+--------+-----------+ | 1 | fox | Rusty | 2 | | 2 | cat | Fluffy | 2 | | 3 | cat | Smudge | 3 | | 4 | cat | Toffee | 3 | | 5 | dog | Pig | 3 | | 6 | hamster | Henry | 1 | | 7 | dog | Honey | 1 | …[Read more]
Join me Wednesday for a free webinar on using the new Percona Toolkit v2.0.3 to verify replication integrity. If you’re not familiar with this topic, it’s one of those must-do things that no one officially tells you is necessary with MySQL. The new tools in Percona Toolkit 2.0.3 make it much easier and less complicated — and safer — than before. Well worth an hour of your time.
Further Reading:
[Read more]MySQL High Availability RealizedJoin us on Tuesday, January 24th at 6:30 pm ETNYC Seminar & Conference Center71 West 23rd St. (corner of 6th Ave.), Suite 515/Lower Level, New York, NYEdward Archibald, CTO at Continuent, will go through a detailed case study to show you how you can start with the MySQL version/build (MySQL Community 5.x, MySQL Enterprise 5.x, MariaDB, Percona, etc.), along with
Nice one ... thank you :)