Showing entries 25481 to 25490 of 44956
« 10 Newer Entries | 10 Older Entries »
Stored Procedure For Finding Columns In MySQL

Looking for instances particular column in a large schema can be a pain. Fortunately the information schema makes this pretty easy, if your columns have a consistent naming convention.

SELECT table_schema, table_name, column_name
FROM information_schema.columns
WHERE column_name LIKE '%some_name%';

Now, if we want to wrap this up into an easy to use stored procedure, we can do something like this:

drop procedure find_column;
delimiter //
CREATE PROCEDURE find_column(c varchar(255))
begin
        SET @a = CONCAT("%", c, "%");
        SELECT table_schema, table_name, column_name, column_type
                FROM information_schema.columns
                WHERE column_name LIKE @a;
end
//
delimiter ;

We need to use the concat statement in order to properly get the quotes in there without using the literal string “c” in the LIKE statement.

You can do a search as follows:

CALL …
[Read more]
The case against the case against Oracle-MySQL

Matt Asay is right, in my opinion, to point out the inherent bias in the case Monty Widenius et al have made against Oracle’s potential ownership of MySQL. I would go further, however, in stating that the case being made against Oracle is flawed by the fact that it is so self-serving. For instance:

  • I previously noted that the Widenius/Mueller case against Oracle owning Sun/MySQL is entirely dependent on the theory that Oracle will not invest in the ongoing development of MySQL, which is something it has publicly committed to doing.
  • The case against Oracle owning Sun is also based on the theory …
[Read more]
innodb_io_capacity

Doing some performance testing on some modern hardware comparing Innodb plugin 1.0.4 with stock Innodb. I'm running a sysbench transactions test (reads and writes) with 200M rows in my table (table size is around 46G, RAM is 16G, buffer pool is set to 12G).

I was puzzled to see the innodb plugin to be decent, but not really as great as I expected, I was doing about ~6100 RW operations a second (individual statements within transactions). Then I compared it to the stock innodb and shockingly I got ~7K ops. I thought about what I tuned that was different in the plugin and came up with the innodb_io_capacity.

read more

Clusterious defined

clus·te·ri·ous |ˈkləstərēəs;|
adjective
highly pleasant to MySQL Support Engineers: A clusterious issue a day, keeps the spouse away.
· clusterful : a hard day.

DERIVATIVES
clusteriously adverb
clusteriousness noun

ORIGIN MySQL Support Team: via Sun Microsystems.

Clusterious
noun
a rare variety of MySQL Support Engineers originally cultivated in Sweden.

best free() is exit()

Whenever any maintenance needs server restarts, there’s a list of unsolved bottlenecks or inefficient code that gets touched a lot at that time. I can understand that heating up the server can take lots of time (though lots of low hanging fruits there), but the way actual shutdown is done, even if there’s not much of dirty data to flush, sucks.

See, developers are perfectionists, and their perfectionism also includes the crazy idea that all memory has to be deallocated at server shutdown, as otherwise Valgrind and other tools will complain that someone leaked memory. Developers will write expensive code in shutdown routines that will traverse every memory structure and deallocate/free() it.

Now, guess what would happen if they wouldn’t write all this expensive memory deallocation code.

Still guessing?

OS would do it for them, much much much faster, without blocking the shutdown for minutes or using …

[Read more]
Four short links: 10 December 2009
  1. Scriblio -- open source CMS and catalogue built on WordPress, with faceted search and browse. (via titine on Delicious)
  2. Useful Temporal Functions and Queries -- SQL tricksies for those working with timeseries data. (via mbiddulph on Delicious)
  3. Optimal Starting Prices for Negotiations and Auctions --Mind Hacks discussion of a research paper on whether high or low initial prices lead to higher price outcomes in negotiations and online auctions. Many negotiation books recommend waiting for the other side to …
[Read more]
xtrabackup-1.0

Dear Community,

As of today release 1.0 is available.

In this release there are following changes:
Changelog:

  • XtraBackup is ported to Windows. The .MSI package as well as .tar.gz is available for 32 bit platform
  • Be more verbose on reporting scp errors

Fixed bugs:

[Read more]
pid file directory and a full disk

To continue the pid file theme I’ve found another slight issue. This was unrelated to the testing which I found the previous pid file issues. I was working on an unmonitored development mysql system. While working on it I ran it out of disk space in /. The box has it’s mysql datadir in a separate partition which had plenty of space. The pid file is in a dir on /. When I started mysqld_safe mysqld exited because it couldn’t create the pid file. mysqld_safe continued to restart mysqld until I saw the problem and killed it a few minutes later. I’m not sure exactly why, I didn’t spend very much time digging into a failure that I caused by filling up the disk. mysqld was exiting because it was trying to create a pid file in a full partition.

Note: This was a stock mysqld, not one running my pid file patch.

Why delayed flushing can result in less work

I can think of at least two major reasons why systems delay flushing changes to durable storage:

1. So they can do the work when it's more convenient.
2. So they can do less work in total.

Let's look at how the second property can be true.

A commenter on Deva's recent post on InnoDB adaptive flushing asked,

That’s really interesting stuff; am I reading it correctly though that adaptive flush actually increased the IOOPS? Looking at the IO graphs, it looks like both the peak IO rate and average IO rate were higher with adaptive flush nabled (assuming I’m reading properly).

Yes. Adaptive flushing actually increased the overall number of I/O operations performed. Smoothing out the workload can cause more work to be done. To see why, remember that InnoDB works in 16kb pages at a time. Suppose …

[Read more]
Response-time optimization in systems that are queued

The best overall method of performance optimization is optimization for response time. Users care about response time, not load average or cache hit ratios. The job of a system is to accept some request and do the required work, and deliver a result. The time elapsed between the request and the result is the response time.

Methods of Response Time Optimization

Not all optimization methods are created equal. Here are a few I see commonly.

  • No method. Most people simply have no method of performance optimization at all. They just look for things that look “bad” and try to make them look “better.” In the MySQL database world, the classic example is trying to improve a cache hit ratio. This is utter folly, and doesn’t become any less stupid no matter how many times it is taught and repeated.
  • Server Load Reduction. One step up from that is to try …
[Read more]
Showing entries 25481 to 25490 of 44956
« 10 Newer Entries | 10 Older Entries »