Chajon: Dunnock no problem, if you see here http://sqlfiddle.com/#!9/54d70/1 DAM9779 shows up twice.
Dyche: JFlash, Oh well, consider this. We have table with: user, activity_id and table with: activity_id, name, even_translation_id
Abrew: JFlash, Now you store: user, activity_id versus user, string_of_activity
Tumminello: JFlash, Which seems more proper?
Lafleche: JFlash, And I do not see why you need multiple joins?
Corners: DAM9779, Cause user voted on two songs, which. if you want line per user add “WHERE clause with G1.id = 1” for example
Ellson: DAM9779, Mean line per song but only by song
Sniezek: While creating joe’s timeline, I have to summon a log of all the activity of joe’s friends is the last , say, 10 days since joe has not logged in
Staton: Dunnock yes I understand that user votes on two songs, so i guess my new question is, is it possible to get all the results in one query? for unique users and count?
Wilken: Suppose joe has 2k friends
Lave: How can I poll several tables for 2k users efficiently, and do it, say, 1 thousand times per second?
Wohlwend: DAM9779, You mean just votes and not really giving a ***** for song id?
Littledave: JFlash, So lets say, Joe logs in and sees the timeline with different activities from friends. that is still single join to events table
Kildare: Dunnock you’ll have to give a **** for something from songs as songs.answered_by tells you who won.
Colvert: DAM9779, Ah : let me see :
Helgerson: And i do appreciate the help btw.
Gerland: Yes, if I have an events table
Knippenberg: So that was the original question
Penman: DAM9779, I read your schema right
Woodhead: Dunnock are you out of TX? My fam is from there.
Kantarian: DAM9779, I kind of waited for something bit more sophisticated
Meggitt: JFlash, Still join with two tables. You need only one join to show the event for Joe’s friend per line
Dilillo: DAM9779, Like across the Atlantic ocean. Near Russia 😀
Knows: Sophistication and my DBs don’t go together.
Sisti: DAM9779, I must have missed something during our convo, my fault. so the songs table is actual answers?
Lovitt: Songs are the games per say, turns are the answers. so you have 3 songs which have been answered or have turns.
Perham: So each song is unique?
Tiger: DAM9779, Give me 15 minutes gonna have a *** and then write you example
Schingeck: Smoke ’em if you got ’em.
Beucke: Dunnock, no what I’m asking if it’s feasable or even better NOT to have the events table
Esh: Because it’s some kind of data duplication, in the end
Ponessa: JFlash, without events table you are duplicating strings like “this event”, “that event” and so on
Petrus: JFlash, with events table you are not duplicating it
Brancato: I’m sorry, I dont understand. the alternative would have to have just a table for likes, one for posts, one for follows, one for play_game, one for attend_some_eventsay party, one for purchased and so on and so forth. and then onion all of these
Covin: Dunnock got it, it was the grouping
Kocaj: Let me clean it up a bit more, but i think i got what i wanted.
Duvall: But remember, If a user has 2k friends that’s 2000k onions on all those tables for each login that I get thousands of logins per second
Panah: Dunnock http://sqlfiddle.com/#!9/54d70/23
Bobsin: Thank you for all your help.
Testerman: DAM9779, Needs optimization: http://sqlfiddle.com/#!9/3b759/1/0
Muckle: DAM9779, But that is many to many relation what you most likely would need
Rade: DAM9779, Oh well, not users table. the tweets table you had. that makes things even bit more complicated in terms of what kind of tables you have. But “Relations” is the magig word