Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

wip: maybe faster delete-unused-pipeline-statuses query

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
date (Jun 15, 2026, 11:15 AM +0100) commit 028f0f3c parent 97e8ed99 change-id ozvqxvpt
+7 -9
+7 -9
appview/db/db.go
··· 2194 2194 2195 2195 orm.RunMigration(conn, logger, "delete-unused-pipeline-statuses", func(tx *sql.Tx) error { 2196 2196 _, err := tx.Exec(` 2197 - delete from pipeline_statuses as p 2198 - where p.status = 'pending' 2199 - and exists ( 2200 - select 1 from pipeline_statuses as q 2201 - where q.pipeline_knot = p.pipeline_knot 2202 - and q.pipeline_rkey = p.pipeline_rkey 2203 - and q.workflow = p.workflow 2204 - and q.status = 'pending' 2205 - and q.created < p.created 2197 + delete from pipeline_statuses 2198 + where status = 'pending' 2199 + and id not in ( 2200 + select min(id) 2201 + from pipeline_statuses 2202 + where status = 'pending' 2203 + group by pipeline_knot, pipeline_rkey, workflow 2206 2204 ); 2207 2205 `) 2208 2206 return err