Files
lix/src/libstore
Sergei TrofimovichandThéophane Hufschmitt 975b0b52e7 ca: add sqlite index on RealisationsRefs(realisationReference)
Without the change any CA deletion triggers linear scan on large
RealisationsRefs table:

    sqlite>.eqp full
    sqlite> delete from RealisationsRefs where realisationReference IN ( select id from Realisations where outputPath = 1234567890 );
    QUERY PLAN
    |--SCAN RealisationsRefs
    `--LIST SUBQUERY 1
       `--SEARCH Realisations USING COVERING INDEX IndexRealisationsRefsOnOutputPath (outputPath=?)

With the change it gets turned into a lookup:

    sqlite> CREATE INDEX IndexRealisationsRefsRealisationReference on RealisationsRefs(realisationReference);
    sqlite> delete from RealisationsRefs where realisationReference IN ( select id from Realisations where outputPath = 1234567890 );
    QUERY PLAN
    |--SEARCH RealisationsRefs USING INDEX IndexRealisationsRefsRealisationReference (realisationReference=?)
    `--LIST SUBQUERY 1
       `--SEARCH Realisations USING COVERING INDEX IndexRealisationsRefsOnOutputPath (outputPath=?)
2022-04-21 10:06:39 +02:00
..
2022-04-08 11:48:30 +02:00
2021-01-06 17:56:53 +01:00
2020-10-06 10:40:07 +02:00
2022-03-31 16:39:18 +02:00
2022-03-03 19:01:25 +00:00
2020-10-11 16:44:19 +00:00
2022-02-21 16:37:25 +01:00
2022-01-27 17:15:43 +01:00
2022-02-21 16:37:25 +01:00
2020-08-06 18:31:48 +00:00
2019-03-14 14:11:12 +01:00
2021-07-26 13:31:09 +02:00
2021-07-26 13:31:09 +02:00
2022-03-31 13:43:20 +02:00
2022-03-31 13:43:20 +02:00
2022-03-09 12:25:35 +01:00
2022-03-11 13:32:16 +00:00