On Tue, 29 Nov 2005, Christian Neukirchen wrote: > Hugh Sasse <hgs / dmu.ac.uk> writes: > > > On Tue, 29 Nov 2005, Christian Neukirchen wrote: > > > >> > At the moment my script to populate the tables is taking about an > >> > hour. Anyway it's mostly ruby I think, because it spends most of > >> > the time setting up the arrays before it populates the db with them. > >> > >> Do you use transactions correctly? > > > > I've only got one process accessing the db at the moment. If you've > > got pointers on common errors, misconceptions, etc I'd be glad to > > learn about them. So I suppose that answer is likely to be "no" > > :-) > > If you need to INSERT bigger chunks of data, put it in an transaction > so it will write the data to disk only once. If you need to insert > even bigger amounts of data, using COPY (usage depends on your > database) can speed things up a lot too. It may be helpful to add > indexes after importing the data. OK, thanks. > Hugh