Files
pipelines/internal/pipeline/search_schema.go
T

15 lines
723 B
Go

package pipeline
// Recent-kind browsing orders canonical table rows before applying the existing
// row/body budgets. These covering order keys avoid sorting the whole history.
// No duplicate search store, FTS wildcard, artifact-content scan or write during
// Search is needed; SQLite maintains the indexes with canonical writes.
func (s *Store) initSearch() error {
_, err := s.db.Exec(`
CREATE INDEX IF NOT EXISTS search_versions_recent ON pipeline_versions(created_at DESC,pipeline_id DESC,version DESC);
CREATE INDEX IF NOT EXISTS search_runs_recent ON pipeline_runs(created_at DESC,id DESC);
CREATE INDEX IF NOT EXISTS search_steps_recent ON run_steps(started_at DESC,run_id DESC,sequence DESC);
`)
return err
}