Showing entries 33496 to 33505 of 43769
« 10 Newer Entries | 10 Older Entries »
Bad SQL or MySQL Bug?

One of my colleagues made a typo in a query today that led to me discovering this issue — I think it’s a bug, though it may just be how the language is defined. But certainly a subquery that cannot run should not act as if it returns TRUE.

mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table foo (fid tinyint unsigned not null primary key); create table bar (bid char(1)
not null default ”);
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

mysql> insert into foo (fid) VALUES (1),(2); insert into bar (bid) VALUES (’1′),(’a');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

[Read more]
MySQL + Secure Digital = Cheap SSDs? (UPDATED)

With the advent of fast and reasonably sized SSD drives, I have to admit that even I, as one who still thinks the standard hard-drive tends to be a better choice, am warming up to solid-state. One crazy benchmark I have always wanted to do is how using consumer flash cards (SecureDigital, CompactFlash, etc.) stack up to their dedicated drive brethren. I just noticed that you can now buy off-brand 4GB High-Speed SD cards for around $10. That is amazingly impressive when you consider, even a few months ago, how much 4GB cards cost. After doing a bit of math, the economics work out pretty well. To match a 64GB SSD drive in capacity, I need 16 4GB SD cards. At $10 a piece, that's only $160. That's a pretty cheap way to match the capacity of an SSD drive without the cost.

Of course, there's a huge catch, or everyone would likely already be doing this. Actually there are quite a few. The numbers I ran don't include the cost of USB card …

[Read more]
The wonders of duelling shared libraries

After seeing strange crashes in xmlFreeTextWriter() on only one platform oldag and me dove into wonders of shared linking.

<oldag> just sit right back, and you'll hear a tale
<oldag> a tale of a faitful trip
<oldag> if not for the courage of the fearless crew (oldag and jan), the Minnow would be lost!
<eric> :)
<oldag> so, who LOVES unix shared lib dynamic linking!
<eric> you know you can sing that to the tune of "Amazing Grace" ?
<oldag> who loves it!
<oldag> come on....
* eric jumps up and down
<eric> Me!
<eric> Me!
<eric> Me!
<eric> not really.
<oldag> so get this
<eric> mmm, hmm?
<oldag> my xml "writer" was being alloc'd by one xml lib
<oldag> and then trying to be freed by another
<oldag> and they disagreed on size
<mark> With different sized structs :P

One libxml was the system libxml in Mac OS X 10.5 (2.6.22), the other one from MacPorts …

[Read more]
Ronald is an evil genius. But we'll get you!

Never in my life I have fallen victim (as severely) to an April Fools joke than the one Ronald played through his blog.

My morning started with checking servers, then heading to PlanetMySQL where I found the "sad" news. Both me and my wife spent the next hour discussing nothing else but Ronald and every topic we could think of related to his 'situation'. In the back of my mind, I was thinking that this could be a joke, but then I thought I knew Ronald well enough that he won't play a joke like this. Of course, I was wrong.

When I got Ronald's message saying "April Fools!" my response was "I HATE YOU!!!!"

In the evening, when I talked to a very good mutual friend, Marc, I found he was equally "mad" at Ronald. Today, I see that we were not alone and poor …

[Read more]
Velocity Conference

O'Reilly's Velocity Conference is happening this year from June 23-24 at Burlingame, CA. Velocity site describes this new conference as:

"Web companies, big and small, face many of the same challenges: sites must be faster, infrastructure needs to scale, and everything must be available to customers at all times, no matter what. Velocity is the place to obtain the crucial skills and knowledge to build successful web sites that are fast, scalable, resilient, and highly available."

When the call for papers was open for Velocity, I submitted a talk proposal regarding cutting MySQL IO for cost effective scaling and performance optimization.

Fotolog is one of the largest sites on the Internet. We are ranked 13th most visited site by Alexa and 3rd most active social network …

[Read more]
All the Reasons to Attend 2008 MySQL Conference

If there ever was a year to be at the MySQL conference, this seems to be it. The keynote lineup has always been excellent, and this year looks to be no exception. I'm guessing there will be quite a round of applause when Jonathan Schwartz takes the stage (slightly more vigorous from MySQL stockholders).

If that's not compelling enough, Werner Vogels (CTO, Amazon) will talk about building the Amazon infrastructure, the scaling MySQL keynote panel (with representatives from Flickr, Facebook, YouTube, and MySQL) is sure to provide some valuable notes, and Raj Cherabuddi will …

[Read more]
Finding optimization opportunities in MySQL by looking at callstacks

Using callstacks to look at code is very useful. If you are not familiar with callstacks, I suggest you read my earlier blog about it. I was trying to understand the mysql code path using sysbench as the test and found something interesting. An image of the callstack is shown below. The SVG version, with much more information, is also available . The width of the block is proportional to the time it took for the function, and the height is the level (or depth) of the stack.

Mysql uses mysql_execute_command() to execute queries. Looking at the callstack you can see very clearly that mysql_execute_command() calls open_and_lock_tables which then tries to open tables via open_table(). The code path gets interesting here. As you can see in the …

[Read more]
Finding optimization opportunities in MySQL by looking at callstacks

Using callstacks to look at code is very useful. If you are not familiar with callstacks, I suggest you read my earlier blog about it. I was trying to understand the mysql code path using sysbench as the test and found something interesting. An image of the callstack is shown below. The SVG version, with much more information, is also available . The width of the block is proportional to the time it took for the function, and the height is the level (or depth) of the stack.

Mysql uses mysql_execute_command() to execute queries. Looking at the callstack you can see very clearly that mysql_execute_command() calls open_and_lock_tables which then tries to open tables via open_table(). The code path gets interesting here. As you can see in …

[Read more]
Ronald "Evil Genius" Bradford Got Me

Of all the practical jokes on April Fool's Day, only one actually got me. Yes, Ronald Bradford's post yesterday describing a visa situation and having to return to Australia actually got me looking up immigration attorney numbers in the US that could help as well as emailing him my heartfelt sympathy about his situation. I even started planning for who might replace him at the MySQL Conference, as it sounded like he was not going to be there.

In response to my email, he wrote back:

April Fools Dude!

to which I wrote back:

Oh, you totally suck.

So, Ronald, you have the dubious honour of duping me (among others, I see). Congrats!

Searching Problems with Dates and Midnight

Today, we run into an issue when a client of ours. They wanted to see some of the data on our website and when doing a search, they didnt see all the days they asked for in the search

Why didn't they see all the data? Because they did a search by date and some of the dates were stored via the website in the form of '2008-01-01 00:00:00' and some were stored via the database in the form of '2008-01-01 12:35:49'.
Now, for some magical reason, if you hide the time in the date in your searches, like so:
where signupdate between '2008-01-01' and '2008-01-02'
or
where signupdate between date('2008-01-01 00:00:00') and date('2008-01-02 00:00:00')
then you might not see all the data between the days 01 to 02.
Depending on which way your date was stored, you might only see the dates between those 2 dates and not equal to those dates as well.

So for example, if you had:

[Read more]
Showing entries 33496 to 33505 of 43769
« 10 Newer Entries | 10 Older Entries »