storage/db: optimize /uploads queries without query string

This uses a different query structure for ListUploads when the query
string is empty. On our production database, this reduces the query
time from ~5s to ~0.1s, which drastically improves the performance of

Change-Id: I1f2bf97449858d1b06791dd352cc437dcbda1fac
Run-TryBot: Quentin Smith <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Russ Cox <>
2 files changed