Practice

You are currently browsing articles tagged Practice.

MySQL specific?

select make_set(255,’bit0′,’bit1′,’bit2′,’bit3′,’bit4′,’bit5′,’bit6′,’bit7′);

select (1,2,3)=(1,2,3);

Tags: , ,

But the first two joins—the inner join, and the left exclusion join—are logically equivalent to a left outer join, so we can write:


SELECT * FROM a LEFT JOIN b ON a.id=b.id
UNION ALL
SELECT * FROM a RIGHT JOIN b ON a.id=b.id WHERE a.id IS NULL;

+------+------+------+------+
| id   | name | id   | name |
+------+------+------+------+
|    1 | a    | NULL | NULL |
|    2 | b    |    2 | b    |
|    1 | a    | NULL | NULL |
| NULL | NULL |    3 | c    |
+------+------+------+------+

Why doesn’t MySQL implement FULL OUTER JOIN syntax for this? We don’t know.

via Common Queries Tree.

Tags: ,

Summary: Showing summaries of many articles is more likely to draw in users than providing full articles, which can quickly exhaust reader interest.

via Corporate Blogs: Front Page Structure Jakob Nielsens Alertbox.

Tags: ,

But let’s stop talking about “backups.” Doing a backup is too low a bar. Any experienced system administrator will tell you that they have a great backup plan, the trouble comes when you have to restore.

via Let’s stop talking about “backups” – Joel on Software:

Twice in October on the home machine – dead internal drive.

The 2 major websites moved off of our servers, but before they moved I did a test restore every 4-5 months.

Tags: ,

Today a customer mentioned reordering a MyISAM table to get rid of fragmentation. I asked them to clarify what they meant by reordering, assuming that they were running an OPTIMIZE or a NULL ALTER TABLE operation and they said that they use ALTER TABLE t1 ORDER BY f1, f2, f3,..etc;

via Things you manage to miss – ALTER TABLE .. ORDER BY – The Soapbox.

Tags: ,

Sometimes, you’re on a team, and you’re busy banging out the code, and somebody comes up to your desk, coffee mug in hand, and starts rattling on about how if you use multi-threaded COM apartments, your app will be 34% sparklier, and it’s not even that hard, because he’s written a bunch of templates, and all you have to do is multiply-inherit from 17 of his templates, each taking an average of 4 arguments, and you barely even have to write the body of the function. It’s just a gigantic list of multiple-inheritence from different classes and hey, presto, multi-apartment threaded COM.

via The Duct Tape Programmer – Joel on Software.

Tags:

Database archiving is becoming an important new topic for data managers. The need for this function has surfaced at most IT organizations, and the problems it addresses are only getting bigger and bigger. These problems include challenges with data retention requirements, application renovations and e-discovery. Most IT data managers recognize the problems but many do not associate database archiving as a solution. This will change as the technology matures and spreads.

via Database Archiving Basics.

Tags: ,

The existence of number tables has always been a little pain. Yes, they’re very, very simple, but they need to be there. So if you just need to script some SQL query, you may find that you need to create such tables. Ummm… this means you need to have privileges (at least CREATE TEMPORARY and INSERT, if not CREATE).

via Generating numbers out of seemingly thin air | code.openark.org.

Tags: