[OSM-dev] Proposed database improvement

David Sheldon dave at earth.li
Thu Aug 31 12:04:27 BST 2006


On Thu, Aug 31, 2006 at 11:54:35AM +0100, Nick Hill wrote:
> In conclusion, David's suggestion of using a union is slightly faster 
> than my idea of using a temporary table. (I am used to MySQL <4.1 so am 
> not particularly familiar with sub-queries). This may or may not be the 
> case when using larger numbers of selects, as my solution replicated 
> indexes on the temporary table so could be more scalable.

I had forgotten that mysql didn't used to be able to do this sort of
thing. The advantange of my solution is that it is a single query, so
can be inserted in place of the current one in the code.

The downside of using the indexes on the temporary table is that they
will need to be kept up to date, and the query analyser will not have
the statistics that it might like to have to decide how to query your
temporary table. I think we will need more benchmarks on larger lists.

David




More information about the dev mailing list