Results 1 to 8 of 8

Thread: what is better

  1. #1
    Join Date
    Apr 2009
    Posts
    15

    Unanswered: what is better

    Hi everyone)
    I'm newbie in database optimization and I have some questions about it:
    First of all, what is better for table that contains messages like posts or tweets or comments: author_id | message or author_fullname | message ? I know that first variant is better, but I don't know why it is better. While displaying the message to the user, you will show the authors name, not id, right? It means you'll need one more request to get the information about author like name, age, etc. So isn't it better to keep the information about author in messages table to avoid one more request?

    How size of a table affects on speed? I thought that if table is well-sorted, retrieving data will be ok despite the size of table. Is it wrong belief?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Design data to Third Normal Form.

    >How size of a table affects on speed?
    Answer depends upon result set
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Research "normalization" and everything will be much more clear (regarding your first question).

    As of a table size: what "size" do you have on mind?

  4. #4
    Join Date
    Apr 2009
    Posts
    15

    Google, Wiki...

    Googling for "normalization" :]

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Apr 2009
    Posts
    15
    Hi, guys)
    I have read about normalization and came to JOINs. JOINs seem to solve my problem but I've heard that JOINs slow down everything(do they?) and it would be good to use VIEWs. But in my situation the WHERE clause is always different, so how to use VIEW if my WHERE clause is always different??? (in my site each time when registered user logs in, his/her friends activity should be displayed(like in fb or twitter), so the WHERE clause is like "WHERE friend1 = $currentUser", where $currentUser is always different)

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Acute View Post
    JOINs seem to solve my problem but I've heard that JOINs slow down everything(do they?) and it would be good to use VIEWs. But in my situation the WHERE clause is always different, so how to use VIEW if my WHERE clause is always different???
    already answered this question elsewhere

    http://www.dbforums.com/database-con...ml#post6491730

    please stop cross-posting
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    I have heard about this chemical that the government uses, but does not want anyone to know about. Dihydrogen Monoxide.

    and yes, this is meant to tell you about the difference between what you hear, and what you test for yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •