On 22/01/2008, Robert (Jamie) Munro <[EMAIL PROTECTED]> wrote: > |> TomH: what do you think about creating a full text index on way_tags > k & v? > | > | We already have one on v, but not k. > | > | I've no objection to putting one on k - it will allow some more > | restrictions on the search API to be lifted. > > Surely k only needs a normal index, not a full text one. For the > purposes of a name finder like thing we just need to search the values > for k=name - I don't know if you can do a conditional index in MySQL. I > have a feeling you can't, which means that it would have to be a > separate table of name tag values.
The problem is that you normally want to search for a combination of key and value and you can't do that with ordinary indexes in MySQL as it will only ever read on one index (obviously if you index on k+v you could, but only for exact values). If you create a full text index on both fields, then you can do a fulltext query to narrow down the records, then exact match those to find the ones you really want. Tom -- Tom Hughes ([EMAIL PROTECTED]) http://www.compton.nu/ _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

