```js const createTable = await env.db.prepare(` CREATE TABLE IF NOT EXISTS ${tableName} ( id

const createTable = await env.db.prepare(`
  CREATE TABLE IF NOT EXISTS ${tableName} (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    blockTs INTEGER,
    value TEXT,
    INDEX idx_blockTs (blockTs)
  )
`).run();


is this correct way to index blockTs? my primary unique key is
id

I could have duplicate blockTs values.
but I want to put index on blockTs because I frequently query data using
timeFrom
  • timeTo
Was this page helpful?