Page MenuHomePhabricator

Daemon worker garbage collector executes query with inefficient key usage
Closed, ResolvedPublic

Description

The Daemon garbage collect runs a query like this:

SELECT * FROM table WHERE dateCreated < X ORDER BY id DESC LIMIT 100

On a huge table, this can't use either the <dateCreated> or <id> keys efficiently. Changing it to ORDER BY dateCreated DESC, id DESC should improve things.

In the cluster, an instance imported the linux kernel, then we ran into trouble 7 days later when GC started.