Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
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 06-18-2008, 08:24 AM
Member
 
Join Date: Jan 2008
Posts: 16
sandeeprao.techno is on a distinguished road
MySql ResultSet
Hello all,

I am using mysql with java to fetch the data from the data base.
I have some three tables with lakhs of rows in it.One of the columns being year.
I am planning to shorten the tables by dividing the tables according to year, without the year column..

Does it take less time to search if I do so???

for example I am doing as

select * from table where year='1990'; (where table has 100000 rows)

I want to do it as

select * from table_1990; (where table has only 1000 rows)

Does it effect in anyways???
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-18-2008, 09:05 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,030
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Obviously if you have less number of rows to search, it's fine. Because you have to involve with less time to search. But that doesn't mean performance wise there is an improvement.
__________________
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.
(Close on September 4, 2008)

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 06-18-2008, 11:22 AM
Senior Member
 
Join Date: Jun 2008
Posts: 181
masijade is on a distinguished road
Create proper indexes and you greatly improve your performance without the "hack" of making multiple tables. Now, if MySQL has partitions (I'm not sure, but I don't think it does), that would be another story.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-18-2008, 12:08 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,030
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
And I think we can make partitions in MySql.
__________________
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.
(Close on September 4, 2008)

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 06-18-2008, 12:23 PM
Member
 
Join Date: Jun 2008
Location: South Africa
Posts: 6
SecretCode is on a distinguished road
At least from MySQL 5.1, partitioning is supported. I don't think it is in 5.0.

But why not make a test for this? Do you have a MySQL server under your control, or a test database you can play with?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 06-18-2008, 02:42 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,030
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Ya, one of a wiki page I see that it support from 5.1. As you said why not test it with an example.
__________________
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.
(Close on September 4, 2008)

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 06-18-2008, 04:14 PM
Senior Member
 
Join Date: Jun 2008
Posts: 181
masijade is on a distinguished road
If it does have partition, great. The last time I worked with MySQL extensively was a version 4.x, I worked briefly with a 5.0, but nothing later, and always (in those 5.0 projects) on things small enough that partitions had never come into question, so I never really looked into it from that point on.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 06-19-2008, 08:41 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,030
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
I never comes with such a situation, because all tables up to now doesn't have large number of data rows.

Even we don't have partitioning directly, I think it is possible to do it through some queries. Basically query less number of rows at a time and do it until end of the table(looping)
__________________
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.
(Close on September 4, 2008)

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
ResultSet size bugger Database 11 08-21-2008 12:12 AM
Can i use a resultset more than once without closing it haneeshrawther Database 5 06-26-2008 04:16 AM
ResultSet to XML Java Tip Java Tips 0 02-14-2008 10:50 AM
ResultSet to HTML Java Tip Java Tips 0 02-12-2008 10:32 AM
ResultSet example Java Tip Java Tips 0 01-20-2008 09:59 AM


All times are GMT +3. The time now is 08:45 AM.


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