〜147m行を書く必要があります。sqlite3のインデックスとRAM
conn = sqlite3.connect('db.db')
cur = conn.cursor()
cur.execute('''CREATE TABLE IF NOT EXISTS NodesRefStop (stop_id text, stop_lat text, stop_lon text,
stop_id_ref text, stop_lat_ref text, stop_lon_ref text, stop_type_ref text, distance REAL)''')
cur.execute('PRAGMA synchronous = 0')
conn.commit()
をしかし、私は、インデックスを追加するとSQLiteはすべて私のRAMを食べる:私は、インデックスなしで私のDBを設定した場合、すべてがうまく動作し
conn = sqlite3.connect('db.db')
cur = conn.cursor()
cur.execute('''CREATE TABLE IF NOT EXISTS NodesRefStop (stop_id text, stop_lat text, stop_lon text,
stop_id_ref text, stop_lat_ref text, stop_lon_ref text, stop_type_ref text, distance REAL)''')
cur.execute("CREATE INDEX dist_index ON NodesRefStop (distance);")
cur.execute("CREATE INDEX stop_id_index ON NodesRefStop (stop_id);")
cur.execute('PRAGMA synchronous = 0')
conn.commit()
私は何をすべきでしょうか?
あなたのリンクから関連情報を回答本体に含めてください。サードパーティのサイトへのリンクは、ページの移動やサイトのダウンに伴って中断することがあります。 –
@ColonelThirtyThoありがとう、あなたは正しいです。私はちょうどユーザーに関連情報といくつかの一般的なアドバイスを提供したいと思っています。これらの記事から情報を抽出するのは難しいでしょう。彼は答えを受け入れたので、彼にとっては十分だったと思います。 –