This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to boost performance

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I'm writing a swing application that contains about a dozen JTables that are each populated with data from an Oracle database. The database is huge and the queries that populate each table take a few seconds to run. Right now I just populate them one by one in a loop which is pretty slow. I'm playing around with spawning a thread for each table so they can all load at the same time, is this the right approach or are there tricks in JDBC that will let me run the queries simultaniously?
Thanx
Dave
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dave,
In the majority of cases, the best way to speed up SQL queries is to
tune the SQL of the query itself, or to tune the database. There is
a wealth of material available on tuning queries in Oracle databases.
In fact, many people make a good living from merely tuning Oracle
database queries. Oracle itself comes with tools that help you tune
your queries.
I don't think there are any "tricks" you can do with JDBC to speed up
these queries.
As regards using multi-threading, if you are on a single processor
machine, I doubt whether multi-threading would help you. But I would
suggest that there is only one way for you to find out for sure:-
try it!
In any case, an optimal performance would probably be gained by a
combination of database tuning and (perhaps) multi-threading. But as
far as I know, the only way to improve the performance is to use the
tried and tested system of:
  • time it and see if the time it takes is acceptable
  • if it's not, profile it to find bottlenecks
  • refactor
  • repeat from step one (1), above


  • Good Luck,
    Avi.
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic