Mysql Unique Index with Null Values

Wherever possible I try to avoid null values in fields but it was necessary to use one on a table where I wanted a unique index and a blank value. At first I did not think this was possible but some research provided that a unique index on a null-able field is perfectly valid.

See the MySQL reference (version 5.5).

A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. For all engines, a UNIQUE index allows multiple NULL values for columns that can contain NULL.

Windows Check Disk Error Log Location

Windows Check Disk Error Log Location

When you choose check disk for errors from the tools tab of a disks properties menu have you ever wonder where the system tucks away the result of the scan?

Well you need to check event viewer application log and find the most recent “win logon” event. If you open this event you will see detailed results of your scan.

Linux Software RAID Tips

Linux Software RAID Tips

After a sever build including a software raid setup let the RAID resync all the partions before continuing to configure or transfer large amounts of data to the server.

You can check the RAID status at any time with cat /proc/mdstat (centos).

Linux RAID resync speed is by default very slow at 1000KB/s, at this speed a modern 3Tb disk set takes approximately 10 days to finish. The rebuilt speed is defined in the config files :

/proc/sys/dev/raid/speed_limit_min
/proc/sys/dev/raid/speed_limit_max

As the names suggest speed_limit_min is a minimum goal speed by default 1000KB/s and speed_limit_max is a maximum goal speed my system has a default of 200000KB/s. To change the values in these files simply change the value in the files.

echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 100000 > /proc/sys/dev/raid/speed_limit_max

My system seemed to be able sustain a resync speed of around 100000KB/s so sensible values maybe  a speed_limit_min of 50000 and a speed_limit_max or 90000. If the minimum or maximum speed is set too high data transfer speed for other operations will be affected.

Once a week on Sunday at 1am my CentOS system is scheduled to resync the drives. Sometimes this is not a convenient time. To change the time edit the file /etc/crond.d/raid-check. To turn off the check completely.