From 549eccc0db48507dfda25aec1d8b0b5b8e1b3d16 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Mon, 3 Dec 2018 21:42:31 -0600 Subject: bitbake: 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] (Bitbake rev: f5ba7775cfcb90401522d977cc66fe0f5aeb7a66) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- bitbake/lib/bb/persist_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py index 1a6319f949..2bc3e766a9 100644 --- a/bitbake/lib/bb/persist_data.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf