concourse / concourse

Concourse is a container-based continuous thing-doer written in Go.
https://concourse-ci.org
Apache License 2.0
7.41k stars 847 forks source link

Investigate using version_id instead of version_md5 #3459

Open jwntrs opened 5 years ago

jwntrs commented 5 years ago

What challenge are you facing?

We reference the version_md5 in a bunch of places, and it seems to really slow down our queries.

What would make this better?

Can we use the version_id instead? At the very least we should probably index version_md5.

clarafu commented 5 years ago

version_md5 is used so that the tables that reference resource versions only need to care about if the specific version (hash) exists instead of caring about concourse's "resource versioning" where versions can be gced from the database and brought back under different version_ids even though they are the exact same versions.

I created another issue (#3460) for investigating the performance differences with using various column types for the version references.

jwntrs commented 5 years ago

If versions are unique and we create foreign key references to map them to scopes/spaces then we would never have to delete the version itself. We would only need to remove the mapping. This means that we would have persistent version_ids that we can use elsewhere.