TABLESAMPLE SYSTEM (0.5) read 30 s of random pages on the HDD at 7M releases, growing with the catalog; a refresh that never finished kept the header's totals 3.5 hours old (it blocked every later refresh). Now TABLESAMPLE SYSTEM_ROWS (5000) (tsm_system_rows), every 5 minutes, and a refresh is given up after 2 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
421 B
TypeScript
13 lines
421 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
/** TABLESAMPLE SYSTEM_ROWS: the stats' sample of the catalog at a fixed size (a percentage read 30 s of random pages on the HDD at 7M releases). */
|
|
export default class extends BaseSchema {
|
|
async up() {
|
|
this.schema.raw(`CREATE EXTENSION IF NOT EXISTS tsm_system_rows`)
|
|
}
|
|
|
|
async down() {
|
|
this.schema.raw(`DROP EXTENSION IF EXISTS tsm_system_rows`)
|
|
}
|
|
}
|