| 169 | } |
| 170 | |
| 171 | async function pickSamplePubkey(): Promise<Buffer | undefined> { |
| 172 | // Production REQ does not filter on deleted_at, so pick the densest pubkey |
| 173 | // regardless of soft-delete state — mirrors what EventRepository.findByFilters |
| 174 | // will actually scan. |
| 175 | const { rows } = await client.query<{ event_pubkey: Buffer }>( |
| 176 | 'SELECT event_pubkey FROM events GROUP BY event_pubkey ORDER BY COUNT(*) DESC LIMIT 1', |
| 177 | ) |
| 178 | return rows[0]?.event_pubkey |
| 179 | } |
| 180 | |
| 181 | function cases(samplePubkey: Buffer): BenchmarkCase[] { |
| 182 | const now = Math.floor(Date.now() / 1000) |