In message <[EMAIL PROTECTED]>
Steven te Brinke <[EMAIL PROTECTED]> wrote:
> The second query uses a join only to select the correct values, not
> because you really want to join the tables. I think that you can achieve
> the same by a query like this:
>
> SELECT *
> FROM current_war_tags
> WHERE id IN (
> SELECT *
> FROM current_ways
> WHERE tile IN (...)
> AND latitude BETWEEN ... AND ...
> AND longitude BETWEEN ... AND ...
> )
> ORDER BY id;
>
> However, I do not know how the db handles subqueries. Thus, I am not
> sure if the performance of this query is better.
MySQL is rubbish at that kind of subquery - it will table scan
the current_ways table and check each one with a lookup in the
external. That's why I wrote it as a join ;-)
My selection criteria were nonsense of course, as this is ways
not nodes...
Tom
--
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev