How are rows inserted with MySQL?

Discussion in 'OT Technology' started by TheDarkHorizon, Dec 23, 2003.

  1. TheDarkHorizon

    TheDarkHorizon \xC0\xFF\xEE

    Joined:
    Sep 26, 2002
    Messages:
    2,396
    Likes Received:
    0
    Location:
    San Francisco, CA
    Is there any logic or pattern for adding rows in MySQL? It seemed to have gone straight in the order I added them in for the first 180 or so I did, and now it seems to be inserting them in random spots.
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    It tries to use up space that was allocated but since deleted. If you want to retain the order you should be adding an additonal field for sorting later on.
     
  3. prophet

    prophet Guest

    The only way I can make it add in order is to have a field increment? I have like 200 rows, and now all of a sudden they start popping up wherever they want. Is there anything I can do to optimize the DB so I can start adding them to the bottom again?
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    You have to ask why you want them to be in order in the first place. If it's a list in order of women you'd like to bang for example, then you should have a field called rating or something and then rate each woman. If you're just wondering why it does it, then it's to save db space ultimately.
     
  5. prophet

    prophet Guest

    I'm wondering if it's possible to bypass that feature so it adds to the bottom no matter what so I won't have to have a field auto-increment to keep the order.
     
  6. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Add a timestamp field and then order by the timestamp.
     
  7. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    It's the wrong way to approach the problem though. So no. :fawk:
     

Share This Page