On 10/11/2011 9:31 PM, Shorty wrote:
Here is an example table:

COLUMNS:
grocery_type, description, price

ROWS:
fruit, apple, 1.23
fruit, banana, 5.35
vegetable, carrot, 1.55
vegetable, spinach, 6.85

-- HERE IS MY QUESTION: --
Is faster for the sqlite database to have the grocery_type as a string
or integer?

I doubt there'll be a noticeable difference until your table grows to hundreds of thousands of rows. But of course integers are somewhat more efficient. It's not so much the cost of comparisons: integers have a more compact representation, so the database file is smaller, so there's less disk I/O to perform. And disk I/O is were the bottleneck is, most of the time.
--
Igor Tandetnik

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

Reply via email to