1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to Optimize Database

Discussion in 'Databases' started by dukhi, Jan 17, 2010.

  1. #1

    My Website is running very slow and Disconnect with Database i tell to my hosting provider.. after 2 day they tell me that " we optimize your database" now website running fast..

    My question is how i Optimize Database by myself ??
    Thank you
    dukhi, Jan 17, 2010 IP
  2. duben

    duben Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Basic optimization for databases:

    1. Use indexes (but be carefull, too much indexes are wrong so index only columns often used for filter, order, joins etc.)
    2. Optimize your scripts, select only data you need, only columns you need
    3. Check DB design, if it is correct
    4. To many calls and calulactions in each query (Sumarization, Groups etc.) could be bad for performance, try pre-calculate values to new table and use them if it's possible and if it make sense from logic side
    5. use stored procedures, they are build ones, and then it should be re-builded each run time.

    Of course main part of optimization is track what is happend with your database, see which queries are run most often, what is their performance, what are slowest queries, what is problem with their slow run, check how it could be optimized.

    Also DB machine could be optimized by settings, how big buffer is used, what are the setting parameters for MySQL (or other DB engine you are using)

    Try some books about database optimizations, usually they have some hundreds pages.
    duben, Jan 18, 2010 IP
  3. Bohra

    Bohra Prominent Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Well normally they play around with the config of the mysql change the settings this pretty much is what ur host did
    Bohra, Jan 18, 2010 IP