INFORMATION_SCHEMA.FILES (querying disk usage from SQL)

In MySQL 5.1.6 there’s a new INFORMATION_SCHEMA table.

Currently, it only has information on files for NDB but we’re hoping to change that in a future release (read: I think it would be neat).

This table is a table generated by the MySQL server listing all the different files that are/could be used by a storage engine. Three (may) be table to file mappings (or not) depending on the engine.

Basically, NDB does files like so:

A table is stored in a tablespace.

A tablespace has datafiles.

Datafiles are of a set size.

Space is allocated in datafiles to tables in a unit called an extent.

If you don’t have any free extents you cannot have new tables store data on disk.

If you don’t have any free extents you may still be able to add data to a table as there may be free space in an extent allocated to that table.

Logs (used for crash recovery) are stored in logfiles.

logfiles are part of logfile groups.

A tablespace uses a logfile group for logging.

Try the following bits of code and running SELECT * from INFORMATION_SCHEMA.FILES between each statement.

CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;

ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;

CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;

ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;

CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK
ENGINE=NDB;

SHOW CREATE TABLE t1;

INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;

DROP TABLE t1;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB;

ALTER TABLESPACE ts1
DROP DATAFILE 'datafile02.dat'
ENGINE = NDB;

DROP TABLESPACE ts1
ENGINE = NDB;

DROP LOGFILE GROUP lg1
ENGINE =NDB;

For a point of interest, these examples are taken from the ndb_dd_basic test (which can be found in mysql-test/t/ndb_dd_basic.test)

Phorum’s RSS sucks

Noticed this about our web based forums today:

the “Re: What is this? “Can’t find record in ”’ on query.”” post on the cluster forum from 10/02/06 07:53:20 isn’t the last message in that thread. there are currently 6 messages of which I only see 2.

Not only that, but from looking at the RSS, I can’t even see this post.

argh! So I shot off an email to our internal guys. The reply was that they don’t have hacking Phorum on their radar (fair enough). Of course, this just means that Phorum sucks[1] (or at least did in the version we do) and adds to the list of reasons why web based forums are much like doing $adjective to $noun.

What is it with new internet lamers and the inability to use an email program? Or even an nntp client (okay, usenet is officially crap now unless you just want spam and pornography) but the tradition of companies having internal/external nntp servers is old, tried and true.

[1] Phorum may itself be a great web based forum. It’s just that all web based forums suck – on principle.

New Category: Inciting Hatred

This is where I will clasify posts that point out how dumb something is. I will feel more free to use explicit language, exaggerated comparisons and will encourage hatred of whatever cheeses me off whenever I choose to write about it.

I would have used “rant” as a category, but this way it’ll screw with those word-scraping spying programs used to “protect” us.

debian installer partitioning tool

It blows slightly less goat than the previous offering.

It totally blows against something like the RH/Fedora tool. Like, they actually work properly and won’t show you something as dumb as LVM VGs and LVs witohut an underlying lvm partition set up anywhere. Oh, and the supremely broken behaviour of giving weird partition error messages repeatedly when I’m trying to set up /boot.

Oh how you irritate me. Isn’t this RAID and LVM thing meant to be easy. So why isn’t it?

Because it’s obviously a good idea to re-invent the bloody wheel a few times, that’s why. I think i would have preferred doing it all on the command line. Fuck that sucks donkey.

icq spam on the increase?

Is anybody else noticing an increase in ICQ spam?

I have an increasing number of random people, without much details messaging me and adding me to their buddy list (or attempting to) saying something like “hi”.

I obviously don’t know them.

For the record, if you’re a real person – say who you are in that first message!

Belated Holiday Blogging

(the following few entries were written at various times, but are now posted after the events).

So back from New Zealand for only a few days before heading off again. This time for a bit of a holiday though!

The plan is as follows:
– Jessie leaves on Wednesday (the day after I get back from NZ), taking my car over so we have a way to drive around and see the countryside.
– I join on the Saturday, taking a week off work to see some of Tasmania as I haven’t been since I was a foetus and would like to actually see and remember the trip this time
– Michael joins us the following Thursday. Ordinarily Jessie would have probably convinced him to do the boyfriendly thing of being there the whole time, but at about a month into a new job, he’s figuring it’s probably not the best idea to skip out for a week.

Just to make things interesting, at the same time I’ve got a bunch of work to do as well as a trip to organise.

I’ve now discovered that in some parts of tassie, mobile phone reception is sketchy (or just non-existent) especially for my carrier (Optarse – oh, I mean Optus – they’re cable Internet bandwidth limitations seem to have scarred me there). So I’ve been playing answering machine message tag with my travel agent Andrew.

In March, I’ll be in London (probably just for a day doing some touristy things on the way through), then Stockholm spending some time with Jonas getting further with online add/drop node and nodegroup for ndb (as he’s not coming to our developer conference due to impending new baby) before finally heading off to Sorrento, a bit out of Naples for the MySQL DevConf. I got hold of Andrew last night (when we stopped in Burnie) and aparrently he’s found a way so that I don’t have to go London -> Stockholm -> London -> Naples and can just go Stockholm -> Rome. That’ll be nice.

Anyway, back to what I’ve been doing in tassie…

Tasmania Day 1 – Friday evening

Working down to the wire, packing at the last minute to head to the airport. Had a bit of the “hope i packed adequately”-itis as heading out, but oh well – worst case scenario I hear they have shops down south.

Drink in the lounge  followed by the short flight from Melbourne (a *lot* shorter than the boat – Jessie said about 11 hours and then a 3hr drive to Hobart – she says she’s not sure if she slept or not, but was pretty tired at the end). The approach into Hobart is pretty impressive (as was the approach into Dunedin a few weeks ago) where you get hills, mountains and trees and not much sign of people. It’s also just great fun to fly into an airport you haven’t flown into before.

Hobart airport is pretty small, but sure enough, you can land a 737 there. Bag came right off the carousel (like the fourth one off) and was out the door in no time. Brilliant.

Oh, and the planes do a u-turn on the runway – there isn’t a taxiway for the whole length. All the stairs also roll up to the plane and it’s sorta like “the terminal is that way” when you get off :)

I got to have the interesting experience of getting picked up by your own car in a different place after just having gotten off a plane. Weird. But nice, as then you don’t have to futz about with a cab or a bus or subway.

Met her brother Mark again – I think we met breifly once in Melbourne… I think…. like for a minute as he was heading out after visiting Jessie. I think… could be wrong. Also met her mother – which was certainly a first. She’s who we’d be staying with for some of the trip. I wonder how Michael will go with the meeting of the gf’s mother? Probably one of the longest relationships without mother meeting among our group.

From what I recall the main events of the rest of the evening was driving home (where home is in New Norfolk – about 30mins out of Hobart – so about 45 from the airport) and dropping Mark off on the way. Had some tea and went to bed (after making some rudimentry plans for the morning)

MySQL Forums :: Cluster :: Re: Any production clusters yet ?

On the MySQL Cluster Forum, there was a thread “any production clusters yet?” to which this was a reply

I’m using NDB in production with a high-traffic web site. We have about 500,000 members and lots of surge activity at specific times. What I’m finding is that the web server goes but the cluster doesn’t break a sweat.

sweet.

comments on online documentation

Something that makes me always just go to dev.mysql.com or php.net for documentation is the user comments. sometimes you just find some real jems that are really worth reading.

It would be great if this somehow could get integrated into the (offline) help system in GNOME could somehow have this stuff integrated. maybe some AJAX foo to fetch comments from the Interweb if you’re connected. So then you get the best of three worlds: good graphical documentation interface, good documentation and user comments to the docs!

mythtv scheduling

So, naturally, while at linux.conf.au I still need to get to my home mythtv box to set (and check) what’s going to be recorded.

I can also have a look to see what my flatmate has set to record.

It looks like I’m missing the tennis one day to have “Dr. Tatiana’s Sex Guide to All Creation” recorded.

Hrrm… for some reason I’m not unhappy with that….

OpenOffice.org barely usable

Trying to fiddle with my linux.conf.au presentation in OpenOffice.org2 (the version that comes with Ubuntu Breezy).

It’s as buggy as all hell.

At the moment, after pasting in some slides from another presentation (if it doesn’t randomly crash some short time afterwards) I can’t save the file. Really useful.

grrr….

MySQL: Can MySQL be run from a CDROM?

MySQL: Can MySQL be run from a CDROM?

The question is asked. The answer is – yes!

Temporary tables can be store anywhere – e.g. the system’s temporary directory (/tmp on unix, probably c:\temp or something on windows… i’m sure there’s one of those %FOO% things for it).

IIRC you may need to start it with a flag or something – but the embedded library – libmysqld (where the mysql server runs within your process – you link to libmysqld instead of libmysql).

Of course, if you’re linking mysql with non-gpl code, you’ll need a license from us.

bloody right thumb

knife left out overnight – with stuff on it. I should point out that I’m not the one who left it out.

Washing it this morning, trying to get gunk off it (what looks like garlic) managed to slice into my right thumb. Also a little on the finger next to it. Blood pouring out. Crap.

No more washing up for me this morning.

At least the knife is sharp though.

GPLv3 Draft — GPLv3

GPLv3 Draft — GPLv3

It’s there for you to take a read. I’ve just read through it and it does sound like a good improvement. I would certainly feel happy licensing my code under this license.

It’s also good to know that MySQL has been and will be further involved in the process (as are many other orgs and companies).