eyeonus/EDDBlink

Suggestion: INSERT OR REPLACE?

Closed this issue · 1 comments

I know close to nothing about SQL, but sqlite3 does have a version of UPSERT called INSERT OR REPLACE (see this and this SO questions. That may be faster than the IF...UPDATE...ELSE...INSERT that you use now. Something to consider, if I understood it properly :)

Thanks!

Nope. It's slower, because it's not equivalent to insert if not exist, update if does, it's equivalent to insert if doesn't exist, delete and insert if does.

Deleting from the database is literally the SLOWEST operation.