Database: INSERTS, speed and primary keys

Monte Goulding monte at sweattechnologies.com
Mon Sep 27 06:31:36 EDT 2010


Hi David
> 
> However if I uses a
> surrogate primary key (ie the usual auto-incremented numeric id field), for
> each updated record I need to check first whether it is already in the
> database before adding it - this is a lot of overhead in terms of finding
> the ids based on other fields.

I haven't yet used SQLYoga but I'm sure Trevor has this all worked out. SQLite will handle the auto increment of integer primary keys when you INSERT without an ID field and then you query 
put revDataFromQuery(,,sDB,"select last_insert_rowid()") into tID

Cheers

--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets

InstallGadget - How to create an installer in 10 seconds
revObjective  - Making behavior scripts behave




More information about the use-livecode mailing list