On 4 Jul 2016, at 11:22am, Jim Wang <2004wqg2...@163.com> wrote:

>    There is a table include id,string1,string2 and so on.
>    So I want to get the value of string1 from a record, there are two methods:
>    1.  get by the name of the string2
>    2.  get by the index of the string2, the index is 2
>   which one is faster?

My guess is method 2, but not by much.  Which one is actually faster depends on 
your exact setup so your only way to find out is to try it.  But you won't see 
much difference so it may be that your time can be better spent doing something 
else.

Don't forget that your main guide to writing software is to make it easy to 
read.  Only if it's too slow to use should you start worrying about the fastest 
methods.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to