mysql - Two identical databases on same server with different running times -


i have 2 databases identical except in 1 have 500.000 entries (distributed on several tables) while other database empty.

if run program in empty database execution takes around 10mins while in database 500k entries execution takes around 40mins. deleted of entries (about 250k entries) , speeded execution around 10mins. strange thing these tables not heavily queried (just simple inserts), wonder how can have such effect on execution.

also, sql statements (i run lot of them) rahter simple (no complicated joins inserts), wonder why tables 250k entries can have such effect on performance. ideas reason?

following things reason actual reasons should , profile queries,

  1. though think making simple inserts, not simple operation db perspective. (for every entry insert following things may change , update

    1. index
    2. constraints
    3. integrity of db (pk-fk) , there many things consider.above things simple take time if volume high
  2. check volume of queries (if high no. of insert queries getting executed might knowing insert exclusive operation i.e. locks table updating , volume high means more locking time , waiting time.) avoid can try chaining or bulk operations is bulk update faster single update in db2?

  3. data distribution plays important role. if accessing heavily loaded tables parsing/accessing/fetching data such tables take time (it doesn't matter single query hurts large volume of similar queries). try minimize tuning queries.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -