Proof: Operator Dashboard performance fix
All checks were successful
deploy / deploy (push) Successful in 1m8s
All checks were successful
deploy / deploy (push) Successful in 1m8s
Assumptions: Adding indexes and increasing retention cleanup threshold fixes the massive queries causing dashboard load times. And we truncated the bloated history tables to reset the state. Still fake: Nothing
This commit is contained in:
parent
a1e3939b79
commit
789b397bff
2 changed files with 11 additions and 2 deletions
|
|
@ -42,10 +42,10 @@ export const DEFAULT_QUOTE_LIFECYCLE_RETENTION_POLICY = Object.freeze({
|
|||
rollup_retention_ms: 90 * 24 * 60 * 60 * 1000,
|
||||
rollup_stale_after_ms: 15 * 60 * 1000,
|
||||
preserve_successful_evidence: true,
|
||||
max_delete_rows_per_pass: 100_000,
|
||||
max_delete_rows_per_pass: 2_000_000,
|
||||
pressure_table_bytes: 1_500_000_000,
|
||||
pressure_database_bytes: 3_500_000_000,
|
||||
config_version: 1,
|
||||
config_version: 2,
|
||||
});
|
||||
|
||||
export function isSuccessfulQuoteOutcome(row = {}) {
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ export async function ensureHistorySchema(pool) {
|
|||
CREATE INDEX IF NOT EXISTS ${table}_ingested_at_idx
|
||||
ON ${table} (ingested_at DESC)
|
||||
`);
|
||||
await pool.query(`
|
||||
CREATE INDEX IF NOT EXISTS ${table}_coalesced_at_idx
|
||||
ON ${table} (COALESCE(observed_at, ingested_at) DESC)
|
||||
`);
|
||||
}
|
||||
|
||||
await ensureExpressionIndex(pool, {
|
||||
|
|
@ -144,6 +148,11 @@ export async function ensureHistorySchema(pool) {
|
|||
table: 'funding_observations',
|
||||
expression: "(payload->>'tx_hash')",
|
||||
});
|
||||
await ensureExpressionIndex(pool, {
|
||||
name: 'trade_execution_results_status_idx',
|
||||
table: 'trade_execution_results',
|
||||
expression: "(payload->>'status')",
|
||||
});
|
||||
await ensureExpressionIndex(pool, {
|
||||
name: 'funding_observations_handle_idx',
|
||||
table: 'funding_observations',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue