In most relational database management systems (RDBMSs) the PRIMARY KEY
is used to define the unique row identifier for a table. But in SQLite, not all primary keys are handled the same way when it comes to indexing.
Depending on how the primary key is defined in a table, it may or may not show up in the list of indexes returned by the PRAGMA index_list()
command. In particular, when the primary key is an INTEGER PRIMARY KEY
, SQLite doesn’t explicitly create a separate index for it.
This article will explain why this happens and provide examples with different types of primary key definitions.
Continue reading