title: sqlite3 index table in python
body: <p>I have created this table in python 2.7 . I use it to store unique pairs name and value. In some queries I search for names and in others I search for values. Lets say that SELECT queries are 50-50. Is there any way to create a table that will be double index (one index on names and another for values) so my program will seek faster the data ? </p>
  
  <p>Here is the database and table creation:</p>
  
  <pre><code>import sqlite3
  #-------------------------db creation ---------------------------------------#
  db1 = sqlite3.connect('/my_db.db')
  cursor = db1.cursor()
  
  cursor.execute("DROP TABLE IF EXISTS my_table")
  
  sql = '''CREATE TABLE my_table (
          name TEXT DEFAULT NULL,
          value INT
          );'''
  cursor.execute(sql)
  
  sql = ("CREATE INDEX index_my_table ON my_table (name);")
  cursor.execute(sql)
  </code></pre>
  
  <p>Or is there any other faster struct for faster value seek ?</p>