-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/02/12 10:13, Hamish Allan wrote:
> 1) Is concatenation on UPDATE performed in-place?

The values for a row are stored sequentially.  Changing the size of a
value will at least require rewriting the row.

I suggest reading the documentation on the file format which will make it
clear how everything is stored:

  http://www.sqlite.org/fileformat2.html

I also suggest you use a profiler to work out where your bottlenecks
actually are rather than worrying about theoretical "efficiency" like
this.  (Put another way, if your code spends 3% of its time in the
critical path doing these updates then look in the other 97% for
improvements.)

If you are trying to reduce the amount of I/O then you'll need something
repeatable while you tweak and tune.  blktrace on Linux can help see what
I/O happens.  If you have more deep instrumenting in your program then you
can make a new VFS that calls the existing ones but in the xRead and
xWrite routines also grab the current query being executed so you can
assign blame.

TLDR: Only worry about "efficiency" when you have accurately measured
issues, and then make sure you have instrumentation as you fine tune to
improve it.  This is rarely a good use of your time.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk8u1FwACgkQmOOfHg372QTHbgCfRl1sY63frasmccFBckdwRWjg
RPAAoJ9xECJNVMu+jvGnbOpOuLZQ0VfQ
=Zuhs
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to