Saturday, May 02, 2026

Chamber music concert

I mentioned in a rather off the cuff manner a few months ago that 'there was supposed to be a chamber concert taking place in the kibbutz in another few hours' but that it was postponed because war with Iran had started that day. Finally, that chamber concert took place today and some of it was wonderful. 

The concert started with a short explanation about the harp as an instrument; this one had been built in the 1840s. The strings of a harp are tuned to a diatonic major scale, begging the question of how sharps and flats are played. It turns out that there are seven pedals at the bottom of the harp, where each pedal has three positions - flat, natural and sharp. This allows all the notes to be played, although sometimes enharmonics have to be employed, eg substituing F# for Gb. I know that Debussy wrote 'La fille aux cheveux de lin' (the girl with the flaxen hair) in the key of Gb which has six flats, so this must be a rather challenging piece to play.

The first piece of music to be played was Gabriel Fauré's 'Sicilienne' (Op. 78); the version that I am familiar with is played by cello and piano. There didn't seem to be much difference to the version played here by violin and harp, but this is always a good solid piece of music.

Next up was a real surprise as it wasn't in the pieces listed in the 'advert' for the concert - Debussy's 'Clair de lune' (the third part of the Suite Bergamasque). I wonder how the harp part was written as the music is notated in Db major with five flats. Surely it would be easier for both instruments simply to transpose the music up a semitone to D major - this would be a good key for the violin as well as two open strings, the D and A, are in this key. This was pure divine magic.

I have a memory of my mother saying that 'Clair de lune' was her favourite piece of music. Of course, I can't check with her as she passed away 24 years ago, and now it seems an odd statement for her to make as I don't have any recollection of her ever passing comment about a piece of music. I can't imagine any context in which she would have made this statement, either. But it is still a beautiful piece of music and the harp makes it more celestial than the piano does.

The other pieces on the set list were not familiar and I didn't enjoy them as much: a piece by Tchaikovsky that I can't name (a section from a violin concerto), Rumanian dances by Bartok, 'Fantasy for violin and harp' by Saint Saens (naturally I enjoyed this more). The final piece was probably part of 'Rapsodie espagnole' by Ravel (I didn't know that he was of Basque origin; I've always considered him to be French). I'm sorry to be so vague on the titles but I don't know the pieces and I'm having to transliteate their original names that were transliterated into Hebrew, so it's hard to be accurate.

The concert took place in a small building that one member turned into an art gallery. I was sitting in the second row on the left (I can recognise the bald patch on my head if I enlarge the picture) so of course the instruments were fairly loud, but they also had a large dynamic range as befitting top professional players.

Internal links
[1] 2083



This day in blog history:

Blog #Date TitleTags
17102/05/2009Heron - River of fortuneHeron
121302/05/2019DietHealth, Anaemia, Diet
175102/05/2024Menaggio in the rainHoliday, Italy, Varenna
193202/05/2025Maeve's songSong writing, Police procedurals

Monday, April 13, 2026

Batch inserts

Yesterday I wrote how it took 3 hours and 13 minutes to migrate a table with slightly over 2M records. I then tried my hand at the 'times' table; I saw that this table contained slightly more than 14 million records and so the migration should take around 21 hours - which it did. At least the program didn't crash. Obviously I had to find a better method - and I did: batch inserts. 

Basically, an array of 2048 records is prepared and then is inserted at one go. This saves multiple commits thus saving time. A 'commit'  permanently saves all changes made during a transaction, making them visible to other users and ensuring data integrity. Naturally this takes a certain amount of time - even if it's a few milliseconds, that adds up when it has to be done 14M times. My batch code needed to do only about 6,900 commits that should save a great deal of time.

I wasn't prepared for how fast migrating a table of 14M would be: four minutes!! That's 315 times faster than the naive method of copying row by row.

The batch inserts were possible in this database because the three large tables are composed solely of integers and there's no need to faff around with codepage conversions.

Here's the code

const batchsize = 2048; procedure Tq400IntMigrate.Button1Click(Sender: TObject); var i, j, k, fieldcount, position: integer; tablename, s: string; begin edit1.Text:= timetostr (time); button1.enabled:= false; for i:= 0 to componentcount - 1 do if components[i] is TCheckBox then if tCheckBox (components[i]).checked then begin tablename:= uppercase (tCheckBox (components[i]).caption); qCount.sql[1]:= tablename; qCount.open; pb.max:= qCount.fields[0].asinteger div batchsize; position:= 0; qDelete.SQL[1]:= tablename; qDelete.Connection:= newcon; qDelete.ExecSQL(); sleep (5000); qBase.sql[1]:= tablename; qBase.open; fieldcount:= qBase.fields.count - 1; s:= 'select '; for j := 0 to fieldcount - 1 do s:= s + qbase.fields[j].fieldname + ', '; s:= s + qBase.fields[fieldcount].fieldname + ' from ' + tablename; SrcQuery.sql.text:= s; srcQuery.open; s:= 'insert into ' + tablename + ' values ('; for j := 0 to fieldcount - 1 do s:= s + ':p' + inttostr (j) + ', '; s:= s + ':p' + inttostr (fieldcount) + ')'; dstquery.sql.text:= s; dstQuery.params.ArraySize:= batchsize; dstQuery.prepare; k:= 0; while not srcquery.eof do begin for j := 0 to fieldcount do case srcquery.fields[j].datatype of ftInteger: dstquery.params[j].asintegers[k]:= srcQuery.fields[j].asinteger; ftLargeInt: dstquery.params[j].aslargeints[k]:= srcQuery.fields[j].asinteger; else dstquery.params[j].asintegers[k]:= srcQuery.fields[j].asinteger; end; inc (k); if k = batchsize then begin dstquery.execute (batchsize); dstquery.connection.Commit; k:= 0; inc (position); pb.position:= position end; srcquery.next end; if k > 0 then begin dstquery.execute (k); dstquery.connection.Commit; end; end; edit2.Text:= timetostr (time); end;

Internal links
[1] 2104



This day in blog history:

Blog #Date TitleTags
34913/04/2011Advanced SQL for me - NULLIFProgramming, SQL
69613/04/2014Fifteen minute mealsCooking
82713/04/2015Vinyl log 3 - 13 AprilDCI Banks, Richard Thompson, Vinyl log
102113/04/2017April thesis updateDBA
160313/04/2023Rain, rain, rainWeather
174213/04/2024Jasmine Myra - KnowingnessJasmine Myra