<html style="direction: ltr;">
<head>
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="preferred-charset"
bgcolor="#FFFFFF" text="#660000">
<div class="moz-cite-prefix">On 25/10/2012 13:00, Johannes Radinger
wrote:<br>
</div>
<blockquote
cite="mid:CABsGe_zYXuYVJXf2ivHw3FXw1oMSeunYeAc1DJh9vZu1U8a3xA@mail.gmail.com"
type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<br>
The first thing that comes to mind is to create an index on both of
the text-key columns<br>
CREATE INDEX idx_table1_key ON table1(key);<br>
CREATE INDEX idx_table2_key ON table2(key);<br>
<br>
What happened to equating the two X and Y coordinates?<br>
<br>
Also did you try Moritz's suggestion to create a new table as a JOIN
between the two originals?<br>
<br>
<blockquote
cite="mid:CABsGe_zYXuYVJXf2ivHw3FXw1oMSeunYeAc1DJh9vZu1U8a3xA@mail.gmail.com"
type="cite">
<pre wrap="">
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:
</pre>
<blockquote type="cite">
<pre wrap="">sqlite> UPDATE vector SET from_csv_col1=(SELECT c.col1 FROM csv_table AS c WHERE c.xy_key=vector.xy_key);
</pre>
</blockquote>
<pre wrap="">
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.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
052-3665918
</pre>
</body>
</html>