From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [Cuirass] Missing database indexes? Date: Tue, 13 Nov 2018 09:10:30 +0100 Message-ID: <87h8glwg7d.fsf@lassieur.org> References: <87va54yh0c.fsf@gnu.org> <20181110211128.6dc522da@alma-ubu> <87k1ljr1c7.fsf@gnu.org> <20181112195044.6d64f51c@alma-ubu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMTmf-000723-40 for guix-devel@gnu.org; Tue, 13 Nov 2018 03:10:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMTmb-0001nc-Bo for guix-devel@gnu.org; Tue, 13 Nov 2018 03:10:52 -0500 In-reply-to: <20181112195044.6d64f51c@alma-ubu> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?utf-8?Q?Bj=C3=B6rn_H=C3=B6fling?= Cc: guix-devel@gnu.org Hi Bj=C3=B6rn, Bj=C3=B6rn H=C3=B6fling writes: > We are directly relying on the rowid here, there is no explicit > id-column. > > This could lead to unpredicted results and reorderings (6th Quirk in > document): > > https://www.sqlite.org/rowidtable.html > > We should add a column: > > id INTEGER PRIMARY KEY AUTOINCREMENT > > Problem is that this concept of AUTOINCREMENT does only work for > Primary Keys in Sqlite. So we need to degrade "derivation" to a > secondary key, i.e. make it non-null and unique: > > derivation TEXT NOT NULL UNIQUE, > > Is there anything speaking against that? We only use that rowid to display a number at the left of every 'build' row. I think it would make more sense to use the derivation name where we currently use the rowid. It would also be more understandable for the users. We don't even need rowid for sorting because we can sort with the timestamps. The only issue is that we get further from hydra, but we are already pretty far away anyway. Cl=C3=A9ment