Here is an example of how to create an index using SQL in SQLite:
1.
2.
3.
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('person', Field('name'))
>>> db.executesql('CREATE INDEX IF NOT EXISTS myidx ON person name;)
Other database dialects have very similar syntaxes but may not support
the optional "IF NOT EXISTS" directive.
Line 3 should be
db.executesql('CREATE INDEX IF NOT EXISTS myidx ON person(name);')