• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Optimizing the query

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI
Please excuse me if these are dump questions.

How to optimize the SQL quereis for better performence.

How can we increase the database performence...?

Can we increse the connection pool size to any number..? How it will effect.?

Thanks
Kim.
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Optimizing SQL statement can be done by looking at how you are using database objects: do you have well placed index, how you partition your tables, do you have appropriate views, how your database memory managed, fast is your hard disk and log hard disk,...

I think you should use an sql profiler or sql query plan analyzer which come with most of databases in order to check your sql statement performance.

But from the Java side you can make your JDBC code works better by using prepared statement where possible, Using correct mode of ResultSet, using batch commands, correct use of auto commit and manual commit, enabling database cache in different level like statement cache, managing JDBC objects correctly by closing them as soon as you can,..

You may increase the pool size to any number that your hardware/ software can accept but it will not guarantee any performance increase.

You should decide on your connection pool size at least based on the following items:
-Maximum number of concurrent database operations.
-Maximum possible time that a database operation may take to complete.
-Maximum time that a database request can be postponed until a connection become available
-etc.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding the pool size - increasing it may actually decrease DB performance, because more users can to access the DB simultaneously (which means each request would take longer to complete).
reply
    Bookmark Topic Watch Topic
  • New Topic