(top posting and not snipping very much so that somebody else can pick up the thread)--I think I'm out of my depth trying to deal with the best (i.e., fastest) way to deal with your data in Ruby/Rails. (If I was to hazard a guess, I might try dealing with each table as an array, just for the sake of speed.)
OTOH, if this is a rails application, presumably there is a client and a server (and TCP/IP communication between them)--is the database processing on the server really the bottleneck? At least one more comment interspersed below. On Tuesday 10 February 2009 09:37 am, [email protected] wrote: > ive toyed around with just using txt files but my limited > understanding of "proper technique" in dealing with them makes them > just as cumbersome... > > im very familiar with normalization and if it was practical (and the > cost didnt outweigh the benefit) id make sure everything was > absolutely 6NF and then some... but coulda, woulda, shoulda... its not > practical.. the best im shooting for is 3NF or 4NF but its not a > stringent requirement... > > i guess you could say i know my way around databases, im just lost > with trying to implement this in a ruby way. my database breakdown > will probably look as follows (i think, unless someone can point me in > a better direction)... > > over time there may be 5000 sheets... each sheet may have up to 20 > columns. each column will eventually belong to exactly one group. each > group may have up to 400 "rows"... .. so if a sheet has 4 columns and > 2 groups like my prev. example and is filled to capacity... theres > going to be 400 rows for each set of groups... 800 rows... they need > to then be translated into one cohesive unit for display. the final > display will have all 4 columns separated into groups and "merged" so > all the "toolnumbers" line up in rows.. displaying only 400 rows. Without a lot more thinking, I don't fully follow the above description. I guess "sheet" is the first thing that puzzles me--is a sheet a table, or is there a table containing up to 5000 sheets? (Maybe the "schema" you list below would answer that and my other questions, but it would probably take me a while to puzzle it out--more time than I have atm.) If I really wanted to understand it, I'd ask for an example using "real" data--sheets, columns, and rows just confuse me (would that be metadata?). > i **think** i understand the database side.. im lost on the ruby > implementation (or any implementation).. is there a "most effective" > way to construct my relationships? > > Sheets > - id (int) > - name (string) > > Columns > - id (int) > - sheet_id (int) > - column_group_id (int) > - name (string) > > ColumnGroups > - id (int) > - name (string) > > Data > - id (int) > - sheet_id (int) > - column_id (int) > - tool_number (string) > - value (int) > > then i'll have a possible array as such for a query like: > select tool_number, value from data where sheet_id = x > > whats an effective way to iterate over the returned dataset and sort > it out into its corresponding columns column groups and rows... im > seeing a join in my head but i dont know on what. > > :( > > hopefully my problem is becoming a little more clear... but the deeper > i dig the more i suspect theres an elegent solution im not advanced > enough to see. Good luck! Randy Kramer -- I didn't have time to write a short letter, so I created a video instead.--with apologies to Cicero, et.al. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

