Did a bit of further testing and when the age field is an integer field and the band field is another field with text datatype then the method with a lookup table is slightly faster. Either way there isn't much in it.
RBS On 11/22/12, Simon Slavin <slav...@bigfraud.org> wrote: > > On 22 Nov 2012, at 5:53pm, Bart Smissaert <bart.smissa...@gmail.com> wrote: > >> Had a look at this, but it looks the method with select case etc. is >> faster, maybe some 20%. This is even without setting up the lookup >> table. > > Fair enough. > >> Also I am not what the benefit is of the order by in your sql. >> Doing this: >> update xxx set band = >> (select band from convert_age ca >> where xxx.band = ca.age) >> seems slightly faster and looks simpler. > > I didn't know that your ca.age value was always at the bottom of a range, > but if it is, then you're right and this will be faster. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users