On 25/10/2012 13:00, Johannes Radinger wrote:
Hi,

thank you for your enspiring answers. I think I'll stick to the direct
sqlite approach
instead of the v.distance.
There are now two tables in my sqlite database, one is connected to
the GRASS vector
 and the other is a table imported from a csv. For both tables I want
to join/merge I created a new column .
This new column contains a text-key (like "123.1232-3424.234"). These
text strings are identical in both
tables that's why I could use them as key.

As both tables have similarly approx. 130 000 rows I am not sure about
the fastest way
to join/merge/append 3 columns from on table to the GRASS vector table
using sqlite?

The first thing that comes to mind is to create an index on both of the text-key columns
CREATE INDEX idx_table1_key ON table1(key);
CREATE INDEX idx_table2_key ON table2(key);

What happened to equating the two X and Y coordinates?
 
Also did you try Moritz's suggestion to create a new table as a JOIN between the two originals?

I tried your approach which took very long time (I stopped the process
after 45 min), thus
I interesting if there is a faster approach than:
sqlite> UPDATE vector SET from_csv_col1=(SELECT c.col1 FROM csv_table AS c WHERE c.xy_key=vector.xy_key);
Is there any way to speed up such a join? As I am newbie to SQL/SQlite, any help
is much appreciated! Maybe this is more a question for a pure
Sqlite/SQL forum...

/johannes

This mail was received via Mail-SeCure System.




-- 
Micha Silver
052-3665918
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to