Search code examples
c#sqlitevarchar

Does varchar without size specification slow down performance of SQLite?


I'm using SQLITE for my Disk catalog project in c#. During testings i'm encountring length issues when using fixed size varchar. So i decided to keep varchar size unlimited while developing. Some times i have to read 40,000 rows in a table at once.

My question is can fixed size varchar increase the performance in sqlite?


Solution

  • SQLite completely ignores any length restriction:

    http://www.sqlite.org/datatype3.html says:

    2.2 Affinity Name Examples

    Note that numeric arguments in parentheses that following the type name (ex: "VARCHAR(255)") are ignored by SQLite - SQLite does not impose any length restrictions (other than the large global SQLITE_MAX_LENGTH limit) on the length of strings, BLOBs or numeric values.