Hi Ludo,

On Thu, 15 Feb 2018 00:17:55 +0100
l...@gnu.org (Ludovic Courtès) wrote:

> Turns out creating the relevant indexes helps a lot, unsurprisingly I
> guess:
> 
>   
> https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git/commit/?id=db27955ad3fae260ee2aa4bace8dd6a4115d338c

Yup.  It's a tradeoff because now the DBMS has to update the indices every time
you insert or update, but reading is now faster.

I guess we query more than we build so it's fine.

> I also discovered SQLite’s “EXPLAIN QUERY PLAN”, which is pretty cool:
> 
>   https://www.sqlite.org/lang_explain.html

Yup :)

> With that /latestbuilds still usually takes a bit more than 2 seconds.
> This could be due to the repeated ‘Outputs’ queries via ‘db-get-outputs’.

Oh yeah, I wanted to optimize that.  It won't be that nice but it will
be faster.

First, I'll send a patch simplifying db-get-builds while retaining the
current functionality.

Reply via email to