mirror of
https://github.com/Haidra-Org/AI-Horde.git
synced 2026-11-06 05:17:31 +00:00
- compile_imagegen_stats_totals/compile_textgen_stats_totals carry all-time totals forward from the previous snapshot and aggregate only rows past last_stat_id, replacing ~10 full-table scans per minute over the never-pruned 55/78 GB stats tables (~32s -> ~2.7s DB time/min); window aggregates collapse into one FILTER pass - compiled_text_gen_stats_totals token columns and total_requests widen to BIGINT: the 30-day token sum passed the int32 ceiling on 2026-07-18 and every run since aborted on INSERT, freezing the text totals endpoints on an 11-day-old snapshot - sql_statements/5.1.2.txt (watermark columns, BIGINT widenings, ix_users_contact, ix_users_proxy_passkey_present recorded idempotently) must be applied before this release starts, since stored procedures auto-apply on startup and the new bodies reference last_stat_id - HORDE_VERSION 5.1.2
AI-Horde Database Information
- postgresql >=15
- pg_cron
pg_cron config
Warning
: All
.sqlfiles found in a directory deeper thansql_statements/will be dynamically run, not only the ones specifically identified in this document. Only place.sqlfiles you intend to run in these directories. This does not apply to thesql_statementslevel (i.e.,sql_statements/4.35.1.sqlis not automatically run, butsql_statements/cron/your_new_file.sqlwill be.)
cron/schedule_cron_job.sql- Creates a stored procedure which schedules a new pg_cron job to execute a specified stored procedure at intervals defined by a cron schedule string, if a job with the same command doesn't already exist.
- e.g.,
CALL schedule_cron_job('0-59 * * * *', 'compile_imagegen_stats_totals');
stored_procedurescompile_*gen_stats_*.sql- These files defined stored procedures which populated the
compiled_*tables and generally represent minute/hour/day/total statistics about generations.
- These files defined stored procedures which populated the
cron_jobs/- Schedules any stats compile jobs via
schedule_cron_job.
- Schedules any stats compile jobs via