Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    2

    Normalization Concept

    Hi Everyone,

    This is my first thread on this forum.

    I have some database concept doubt that i explain using two cases.

    Case 1. There is two table A and B

    Relationship between table A and B is (A (1) - > B(M)).

    Case 2. there is three table A,B and AB

    A and B table relationship are maintained in AB.

    Both table A and B has a million of record.

    now if i want to fetch the record from database then which case is better.
    Case 1 or case 2.

    Accordingly me Case 2 is better because when we are fetching record.
    From any table it will scan the table AB and only scan the subset of B which we are getting from table AB.

    now i need people suggestions to which case is better.

    Thanks,
    Ganesh Shirsat

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    The first instance represents a one-to-many relationship.
    The second instance represents a many-to-many relationship.
    The first instance is faster, so use it whenever a many-to-many relationship is not required. But if a many-to-many relationship is required then you must use the second instance.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Thanks blindman for your suggestion.

    could you please explain me, how second instance is better?

    how exactly database explain plan on both instance?.

    is there is any way to find this all minor detail?

    thanks

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Which is better, a fork or a spoon?
    Neither is "better". They do two different things. The first represents a one-to-many relationship, and the second represents a many-to-many relationship.
    Use whichever one is appropriate for your business requirements.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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