The Gothic Temple, Landmark Trust, Stowe

Having just come back from a trip to Landmark Trust’s ‘Gothic Temple’ in Stowe I can absolutely recommend it. Staying in a temple in the middle of dozens of acres of National Trust grounds is fantastic. The temple has a triangular footprint wrapped around the central circular (domed) space with turrets at each corner of the triange. One turret is the stair tower, the other two are bathroom and kitchen (ground floor) and double bedrooms (first floor).

The nearest pub (The Queens Head) is a bit of a trek. The walkable route involves the back gate to the grounds being open; this is supposedly Wednesday to Sunday but we found it closed on Sunday. There is a small wall to climb down and a field to trek across which we didn’t find too much trouble. The food in the pub is definitely worth the journey, though, although unfortunately they get fully booked up on a Sunday.

The grounds of Stowe themseves can also occupy quite a few hours. There are a number of follies and temples in the gardens, all positioned for views and generally not as interesting once you actually get near to them.
Other sites nearby:

The Rothschilds place (can’t remember the name of it), which was extremely decadent and interesting mainly for Baron von Rothschilds general lack of taste.
Silverstone: just about within earshot, but didn’t go any closer.

For booking the Gothic Temple contact The Landmark Trust.

Optimising MySQL a query with packed keys

I’ve been learning more about MySQL lately and particularly optimising
SQL queries on large tables. Large, in this case, being at the moment
hundreds of thousands of rows but soon to be millions. One of the
problems I’ve had is that MySQL sometimes decides not to use an index
even when a handy one seems to have been created for it. The root of
this appears to be to that with B-tree indexes if there are a large number of records with similar looking values then the MySQL engine may decide that it’s just as much effort using the index as to search the whole table.

The answer appears to be adding PACK_KEYS = 1 to the end of a create
table, or running the SQL command ALTER TABLE MyTable PACK_KEYS = 1 once
the table has been created. In effect, this takes account of the
similarity of adjacent keys. In our case we have a large column of field
type bigint(21) where the starting digits of the index are timestamp
generated. So, at present, we end up with a few tens of thousand rows
all starting with 108xx. Enabling packed keys means not only that the
index is smaller as MySQL only needs to store the differences between
keys (plus an extra byte to keep track of where the similarity starts)
but also that the index is actually of some use i.e. doesn’t become a
large, flat structure.

One down side of using packed keys is that inserts are slower, but given
that the system we are building is inserting each row once and then (in
theory) never touching it again that’s a small price to pay. The other major drawback, however, is that packed keys only works on MyISAM tables at present and not InnoDB. This actually isn’t much use to me as the large inserts we occassionally have to do would end up with MyISAM locking the table for perhaps an hour or more.

Pack keys
reference in the MySQL manual

At last I’ve gotten round to writing something!

Having signed up for blogger back in september 2003 it’s now taken me just over a year to get round to writing a first proper post. A short intro: I’m a director of a web development company called Exponetic based in Bethnal Green, London.

If you haven’t been to Bethnal Green: it’s a marvellous place. Where else could you buy something like this?:

Bethnal Green curiosity