aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-12-03 21:42:31 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-07 12:38:17 +0000
commitf5ba7775cfcb90401522d977cc66fe0f5aeb7a66 (patch)
treeca2f8fa7b0d087efe55000cd31a5e04a085005eb /lib
parente8b9d3f534ef404780be23b601d5a4bb9cec928a (diff)
downloadbitbake-f5ba7775cfcb90401522d977cc66fe0f5aeb7a66.tar.gz
persist_data: Add key constraints
Constructs the "key" column in the persistent database as a non-NULL primary key. This significantly speeds up lookup operations in large databases. [YOCTO #13030] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/persist_data.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index 1a6319f94..2bc3e766a 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -94,7 +94,7 @@ class SQLTable(collections.MutableMapping):
self.table = table
self.connection = connect(self.cachefile)
- self._execute_single("CREATE TABLE IF NOT EXISTS %s(key TEXT, value TEXT);" % table)
+ self._execute_single("CREATE TABLE IF NOT EXISTS %s(key TEXT PRIMARY KEY NOT NULL, value TEXT);" % table)
@_Decorators.retry
@_Decorators.transaction