internal/postgres: fix versions query
internal/postgres: fix versions query

I believe the versions query got slow after the deletion of the major, minor,
patch and prerelease columns because an index was removed, so the query picked
a different index which is much worse.

We observed that there is only one v1path for a package path anyway,
so we removed the WITH and tweaked the nested query. Now it is fast again.

Fixes b/146667598
Fixes b/146662203

Change-Id: I738f037e65e07c5f18c883b0880f596b87b64345
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/623925
Reviewed-by: Julie Qiu <e6cb64861edcc38971590ff27c111e0e672de045@google.com>
Reviewed-by: Robert Findley <9179eee875d1ee628c37fb47d7e749e855ffd21f@google.com>

golang/pkgsite,golang/pkgsite,golang/pkgsite,golang/pkgsite