Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Process and combine two CSV files into one

by SimonClinch (Deacon)
on Aug 15, 2005 at 08:02 UTC ( #483788=note: print w/replies, xml ) Need Help??


in reply to Re^2: Process and combine two CSV files into one
in thread Process and combine two CSV files into one

The ambiguity error is because the IP just after the SELECT needs to be qualified by its table name (or alternatively could be by an alias name had you used aliases) - just put the table name follwed by a dot in front of that IP.

Changing the column name (all other things being equal) simply forced it to interpret the same as a literal - you want to undo that change.

It is normal for three tables to take much longer than two to join. The performance strategy for joining tables 1..n where n>2 is as follows:-

- Join the first two tables placing the required columns in a temporary table.

- Then join the third table with the temporary table, putting the results in a second temporary table and drop the first temporary table.

- Continue this iterative process of joining a results temporary table with the next real table until joining the last real table with the last temporary table at which point the final results can be obtained directly instead of storing in a temporary table - this way no more than two tables are physically joined at once, whereas any number of tables have been logically joined.

- If this query is intended to be re-used it should be placed in a stored procedure, not inside perl code, to prevent unnecessary communications overheads during execution, especially now that it has been split up. For this reason, ideally in terms of performance as well as other considerations, any re-used process of more than one SQL statement should be placed inside a stored procedure.

Hope this helps!

-S

One world, one people

  • Comment on Re^3: Process and combine two CSV files into one

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://483788]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2018-01-21 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (227 votes). Check out past polls.

    Notices?