Hi all,
         I create a table with 200 columns, then use sqlite3_prepare() and
sqlite3_step()
    to get a record by this: "select * from tbl where ID =.. ". Test in my
embedded system
    The total time is about 65ms,it is too long for the performance
requirement, I found
    sqlite3_prepare() time is about 50ms. Then test the code with VTune, I
found
    lookupName() function in Sqlite take about 50% of the total time,
   and sqlite3StrICmp() occupied  most execution time (867/922, see the
follow pics ) in lookupName().
       The follow is  the graph info link grnerate by VTune:
    http://img15.tianya.cn/photo/2008/11/18/10872206_2807293.jpg
    http://img15.tianya.cn/photo/2008/11/18/10872205_2807293.jpg
        If  use "select * from tbl where...." ,tbl is a table with 200
columns,
   sqlite3StrICmp() will be executed more than  20000 times in
lookupName(),this
is the main bottleneck
   in sqlite3_prepare().
        I think maybe Sqlite should do a special Optimization for "select
*.......",   and  there is
  no necessary to compare the column names expand by "*" with the table
column names.
       Are there some efficient ways to get a whole record with many many
columns ?

      Thanks very much!
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to