Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed comparison between entering entries by PHP and using another tbl

Status
Not open for further replies.

dcnguyen

Technical User
Mar 22, 2005
54
0
0
US
Was just wondering...Let's say I have a table with 100,000 address entries associated with other info, such as resident names, and I have a text file with the lat/long coordinates for those addresses.

So I want to put that lat/long data into the address table. Is it faster to create a table using the text file, then running an update query using those two tables...Or is it quicker to write a php script that enters the lat/long data?
 
That would depend on how proficient you are with PHP. and how the text file is set up. I would think if its properly set up, it would take only a few lines of code to do.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I meant as from a performance aspect...I only know how to work with MYSQL and PHP, not the tech specs behind them...It seems more convenient to do it with a PHP script, the way I have things set up, but I figured mysql just had inherent advantages when combining data between two tables.
 
with mysql you can use LOAD DATA INFILE which will be significantly faster than anything you can do with PHP.

what do your tables look like and what exactly are you trying to add? to me it seems like the data you would be updating should be in a separate table with a foreign key to your first table.
 
OK, one table is something like this:

address/date/description


The other table is address/lat/long

There are hundreds of thousands of entries...I've been playing around with geocoders and I've only found one interface that does batch geocoding with the geocoordinate database that I want...And with that one, I can't just directly geocode the addresses...So I've created that second table, of just addresses, and put it through this geocoder...and in the end, I want one table that has:

address/date/description/lat/long

I could do a foriegn key but there really aren't that many duplicate entries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top