Jump to content

load sql database faster..


subhomoy

Recommended Posts

hello every one...

 

I have a database that  need to be queried more than 2 lakh rows... but after quering 10,000 results or so,, the mysql is taking longer time to load....

 

Is there any way to upload those rows to dat database faster.....

 

And i'm thing if it were taking so much time to load, then how much time will it take to query results from it....

 

Any help guys.....

 

Thank you in advance....

 

 

Link to comment
Share on other sites

I have done like this

 

INSERT INTO ip2country (id,begin_ip,end_ip,begin_long_ip,end_long_ip,country_code,country_name,country_flag) VALUES ('','5.8.248.0','5.8.255.255','84473856','84475903','HU','Hungary','/images/ip2c/HU.jpg');
INSERT INTO ip2country (id,begin_ip,end_ip,begin_long_ip,end_long_ip,country_code,country_name,country_flag) VALUES ('','
5.28.0.0','5.28.7.255','85721088','85723135','HU','Hungary','/images/ip2c/HU.jpg');
INSERT INTO ip2country (id,begin_ip,end_ip,begin_long_ip,end_long_ip,country_code,country_name,country_flag) VALUES ('','
5.38.128.0','5.38.255.255','86409216','86441983','HU','Hungary','/images/ip2c/HU.jpg');
INSERT INTO ip2country (id,begin_ip,end_ip,begin_long_ip,end_long_ip,country_code,country_name,country_flag) VALUES ('','
5.56.32.0','5.56.39.255','87564288','87566335','HU','Hungary','/images/ip2c/HU.jpg');
.

.

.

.

.

 

So on....

 

Suppose i'have done all the uploading.. then how will i query from those thousand of results... It taking much longer time to load... Is there any easy way...

 

I have heard about indexex but dont know...can u help me....

Link to comment
Share on other sites

Yes any queries you have that are included in the where clause should have an index created on them. The only exception would be low cardinality values (for example a status flag or boolean) although those can be part of a multi-column index.

 

As far as loading speed you can probably improve that using one or more of the suggestions provided here: http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html

 

If you're using INNODB tables you want to make sure you turn auto commit off.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.