SQLite Forum

Understanding memory allocation behavior of SQLite
Login
In the following table definition taken from your post (with all your bad quotes fixed):

```
CREATE TABLE table_name 
(
   col1 INTEGER, 
   col2 INTEGER, 
   col3 INTEGER, 
   col4 INTEGER, 
   col5 STRING, 
   PRIMARY KEY(col1, col2, col3)
) WITHOUT ROWID;
```

Firstly, the index is on (col1, col2, col3).  You would need a CREATE INDEX statement to create an additional index.

Secondly, STRING is not a known datatype.  It is an alias for NUMERIC.  If you actually intend to store "UNICODE TEXT" in this column then it may be perspicacious to declare the type as TEXT in order to avoid forcing the exercize of the conversion path (and the multiple malloc/free calls associated therewith) which will never be applicable (and cause a massive usage of CPU and memory for no useful purpose).

Thirdly, are you loading the table in-order?