Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tips for Better JDBC querying

 
Jack Daniel
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi e'body,

Well, I am in a project where you query {DB2} database tables, having more than a million records;

So what do you guys think is a better way to handle such a situation??

I anyway use DataSource Connection Pooling;
any tips on optimized ways of querying is greatly appreciated..!!

looking forward to hear from you guys.. i know, you guys have great ideas..
Thanks :-)

PS: if anyone can forward links where i can find optimized ways of querying, that would be great
[ September 13, 2004: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant,
The most important thing is well though out indexes. Also, run your queries through db2 explain to find optimizations.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but indexes doesn't help in full table scan. i think we should avoid full table scans in these kind of situations.

tips:

- indexes help in query
- indexes may suck when there is lots of updates

so be careful
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adeel,
I agree with what you said. As Prashant's table has millions of rows, a full table scan is unlikely to be occuring.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic