I might be being a bit thick, but I don't get why you're doing this. Albumns have 1 or more releases, so the 2 tables you have currently makes perfect sense to me - its exactly how I'd model it. So you want to merge the 2 tables together into one table that has one entry per albumn, but say a comma-seperated list of releases, is that what you're thinking? Thats going to make working with the table quite tricky right?
I'm not sure how much space you'd save, I don't see a massive saving here. And I don't think that performance should be a problem with these 2 tables either, unless you have some kind of nested iteration through albumns thats taking ages (and if so can you re-design you're UI to fix this issue?) Perhaps a de-normalised view over these 2 tables would help you out? Just my 2p worth :) Matt On Wed, Oct 21, 2009 at 2:51 PM, Alex Barlow <[email protected]> wrote: > > Ok guys, heres something I came across today which I have an idea of > what I could do, but im sure theres an easier way.. > > I have an ActiveRecord class called Releases and one called Albums, im > merging to two tables together to a)save space and b)speed up sql > called because theres no joins. > > Here a show of the releases table (postgres if your interested) > showing all with the album_id 46. > > http://arbarlow.s3.amazonaws.com/nwrug.png > > I have an Album that has an id 46 and i want to now add the > country_id, label_id and realease_date to it, but since theres more > than one release row, i need to find a way to condense the array the > find the most common values and then save that to the Album table. > > Does this seem like a good idea or am I thinking to hard here? > > Cheers, Alex > > > > -- :O) Matt Roberts --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NWRUG" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nwrug-members?hl=en -~----------~----~----~----~------~----~------~--~---
