So rather than making it such that to compute this, you have to do a select against the tracks table, for example, for any/all tracks that might match this jamid, why not instead just have it be something that is modified on creation. That is, on default, these are all set to false as columns in the table for jams and then if you add tracks, successfully, this gets set to true for tracks, and if you remove a track... are there any tracks? Set it to that value.
So rather than making it such that to compute this, you have to do a select against the
tracks
table, for example, for any/all tracks that might match this jamid, why not instead just have it be something that is modified on creation. That is, on default, these are all set to false as columns in the table for jams and then if you add tracks, successfully, this gets set to true for tracks, and if you remove a track... are there any tracks? Set it to that value.