Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-26-2008, 09:17 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 228
Eku is on a distinguished road
A small Question
Does anyone know how can i improve the speed of retrieving a result set from a query?

Here is my scenario, Im using Java as my front end. In small scale to medium scale(around 100K rows in DB) database it works OK. But the problem is when im fetching a specific column in a huge database. Example im going to get all calls of a telephone specific number for the previous month. Ot took me around 2 hours just to get that data. The Database is Gigantic, it contains all calls of all telephone numbers of our company's subscribers. it s like a whole country, our database warehouse only contains the last 3 months of those records. Can anyone had a idea to speed it up a little.

What im doing is fetching the record they want to rebill and fixed the problem, My program fetches that record and i have my own database where the user can save that fetch records and store it. so that there would only be 1 connection per record, if that record exist locally it would retrieve the local copy. I hope someone migth give me an idea =P
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-26-2008, 10:38 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,412
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
I'm not clever with DBMS. But most of developers talking about data partitioning. Kind of a partitioning on a database and work on them. Did you know about that more?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-28-2008, 07:58 PM
ProjectKaiser's Avatar
Member
 
Join Date: Aug 2008
Location: Saint-Petersburg, Russia
Posts: 47
ProjectKaiser is on a distinguished road
Quote:
Originally Posted by Eku View Post
Ot took me around 2 hours just to get that data.
Answer "depends".
1) How many approx. rows you get as a result during 2 hours ?
2) Do you have an index for "telephone number" field ?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-30-2008, 05:03 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,412
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by ProjectKaiser View Post
2) Do you have an index for "telephone number" field ?
Are you talking about data row index? It's a really bad practice if don't have, right. In most of development my DBMS admin talking seriously about that.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 08-31-2008, 05:44 PM
ProjectKaiser's Avatar
Member
 
Join Date: Aug 2008
Location: Saint-Petersburg, Russia
Posts: 47
ProjectKaiser is on a distinguished road
I'm talking about something like:
Code:
create index my_table_phone_number on my_table(phone_number)
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 08-31-2008, 08:05 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,412
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Hey ProjectKaiser, what's the use of it even need to retrieve large number of data. How can be this is helpful on that? I'm asking this, because I'm not much familiar with DB related development and I want to learn something on this.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 09-01-2008, 07:54 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 459
fishtoprecords is on a distinguished road
Quote:
Originally Posted by Eranga View Post
Hey ProjectKaiser, what's the use of it even need to retrieve large number of data. How can be this is helpful on that? I'm asking this, because I'm not much familiar with DB related development and I want to learn something on this.
I'm not Kaiser. But if you have something like all the call data records of a telco switch or of a cell tower, then there are millions of records reflecting the thousands of numbers that use the switch or telco.

So by using an index on the "phone_number" field, and doing an equals search, you are eliminating millions of records that don't match. Thus you only have to search through the records for the calls you made.

A select using something like
select * from bigcallrecordtable where phone_number = "201 555-1212" is massively faster with an index than without.

If you don't work in the DBMS space, you probably should let someone who does answer the questions.

And OP, your thread title leaves a lot to be desired. Better titles are likely to get more responses.

The OP doesn't talk about how many tables are being joined, how many fields are being searches, whether or not a "like" verb is being used, etc.

DBMS query optimization is a wide open topic, there are lots of books on it, and there are PhD dissertations yet to be written
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 09-01-2008, 08:10 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,412
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Quote:
Originally Posted by fishtoprecords View Post
I'm not Kaiser. But if you have something like all the call data records of a telco switch or of a cell tower, then there are millions of records reflecting the thousands of numbers that use the switch or telco.

So by using an index on the "phone_number" field, and doing an equals search, you are eliminating millions of records that don't match. Thus you only have to search through the records for the calls you made.

A select using something like
select * from bigcallrecordtable where phone_number = "201 555-1212" is massively faster with an index than without.
Thanks for the explanation pal. It's really helpful to me and better to learn more about DBMS.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent small code karingulanagaraj New To Java 7 08-11-2008 06:11 AM
Small problem ayoood New To Java 2 06-06-2008 02:27 PM
small error ayoood New To Java 23 05-27-2008 02:18 PM
small issues with a program jimJohnson New To Java 6 04-25-2008 10:28 AM
Small tennis simulation in Java diego New To Java 1 12-02-2007 03:32 AM


All times are GMT +3. The time now is 01:24 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org