TRANSIENT INDEX (SQLite)
TRANSIENT INDEX (SQLite) is a SQL statement in the SQLite Specific category. SQLite: indexes on temporary tables exist only for the duration of the session. Created automatically for temp tables. The syntax is CREATE INDEX temp.idx_temp ON temp.temp_table (col);. It returns temporary index. A typical example: CREATE TEMP TABLE temp_results (id INT, name TEXT, score INT); INSERT INTO temp_results SELECT id, name, score FROM large_dataset; CREATE INDEX temp.idx_score ON temp.temp_results (score); -- Index exists only for this session -- Automatically dropped when connection closes -- For faster temp table operations: CREATE TEMP TABLE temp_fast(c1, c2) AS SELECT * FROM big_table WHERE 1=0; A close relative is AUTOINCREMENT (SQLite), which sQLite: unlike AUTO_INCREMENT in MySQL, only INTEGER PRIMARY KEY columns auto-increment. AUTOINCREMENT guarantees unique increasing IDs. A close relative is ROWID / _ROWID_, which sQLite: every row has an implicit 64-bit ROWID. INTEGER PRIMARY KEY becomes an alias for ROWID.