Skip to content
Permalink
Browse files

Reordering of columns (for better performance?)

  • Loading branch information...
spirali committed Aug 9, 2019
1 parent 678148e commit d338f179cf6e2d71e231c5ad0ceeac63e80bc194
Showing with 5 additions and 6 deletions.
  1. +5 −6 orco/db.py
@@ -61,10 +61,10 @@ def _helper():
cursor.execute("""
CREATE TABLE IF NOT EXISTS executors (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
created TEXT NOT NULL,
heartbeat TEXT NOT NULL,
heartbeat_interval FLOAT NOT NULL,
stats TEXT,
created TEXT NOT NULL,
type STRING NOT NULL,
version STRING NOT NULL,
resources STRING NOT NULL
@@ -75,12 +75,11 @@ def _helper():
CREATE TABLE IF NOT EXISTS entries (
collection STRING NOT NULL,
key TEXT NOT NULL,
config BLOB NOT NULL,
executor INTEGER,
value BLOB,
config BLOB NOT NULL,
value_repr STRING,
created TEXT,
executor INTEGER,
comp_time FLOAT,
PRIMARY KEY (collection, key)
@@ -165,11 +164,11 @@ def _helper():

def create_entries(self, raw_entries):
def _helper():
data = [(e.collection_name, e.key, e.config, e.value,
data = [(e.collection_name, e.key, e.value, e.config,
e.value_repr) for e in raw_entries]
with self.conn:
c = self.conn.cursor()
c.executemany("INSERT INTO entries VALUES (?, ?, ?, ?, ?, DATETIME('now'), null, null)", data)
c.executemany("INSERT INTO entries VALUES (?, ?, null, ?, ?, ?, DATETIME('now'), null)", data)
self._run(_helper)

def set_entry_values(self, executor_id, raw_entries, stats=None):

0 comments on commit d338f17

Please sign in to comment.
You can’t perform that action at this time.