Fast Insert

Discussion in 'MySQL' started by deriklogov, Nov 8, 2009.

  1. #1
    How to tune up mysql server to make INSERT work very fast without any extra access to hard drive ?(make server very slow)
     
    deriklogov, Nov 8, 2009 IP
  2. plantium

    plantium Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    insert queries are the fastest queries in sql, so you can use such a cache system to decrease usage of select queries.
     
    plantium, Nov 9, 2009 IP
  3. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #3
    please share purpose or the practical example you have come across, this will help us give you best feasible solution.

    because i can simply say, keep archive table and your inserts will be fast. keep myisam table with only one auto_increment column and your inserts will be fast..
     
    mastermunj, Nov 9, 2009 IP
  4. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Disable any and all logging within the database, use a lazy writing filesystem.
    Or run your client and server within the same OS and use an load local infile to directly load csv files which is orders of magnitude faster then regular inserts.

    Or utilize an embedded DB within your application to eliminated protocol overhead and transmissions overhead, these become an api call, you still need to make sure it does no logging and uses lazy writing.
     
    chisara, Nov 9, 2009 IP
  5. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #5
    How to turn off all logging and how to use that lazy writing filesystem ?



     
    deriklogov, Nov 9, 2009 IP
  6. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #6
    and if you could please explain about that embedded DB and how it works ?

    thank you very much for your replies
     
    deriklogov, Nov 9, 2009 IP
  7. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #7
    I am having some very heavy crawlers which collect information and insert it into mysql, it could be 100 parallel working scripts which doing inserts at the same time, what I already did is used group insert instead of single inserts, still very slow

     
    deriklogov, Nov 9, 2009 IP
  8. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    chisara, Nov 10, 2009 IP
  9. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #9
    What is nutch what does it do ?
     
    deriklogov, Nov 10, 2009 IP
  10. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #10
    So many professionals... I need more advices Please
     
    deriklogov, Nov 10, 2009 IP
  11. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Nutch is a project that makes an open source webcrawler, this software is used at several sites.

    What you can learn from the is how to make your system scale.
    This is the same project that runs the hadoop project that aims to replicate the Google Filesystem and HBase which aims to replicate Google BigTables Database.
    Since Yahoo uses these Hadoop and HBase programs on a 10.000 node system I am inclined to believe it works.

    Don't think databases, think architecture for your solution, and if you have 100 parallel crawlers and you want to proces that data then you can really learn from people who implemented Nutch / Hadoop systems.
    Research the Internet for you guidance.
     
    chisara, Nov 11, 2009 IP
  12. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,079
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #12
    Thanks ,

    What do you know about /etc/fstab
    I read somewhere that with heavy use database it makes I/O going crazy because it has to write to file(update last access time) every time you access database even with SELECT, some people suggesting to set MYSQL database files to NOATIME which make it update only in case of writing to DB.

    What is your opinion about that ?
     
    deriklogov, Nov 11, 2009 IP