MySQL Forums
Forum List  »  PostgreSQL

Re: Confusion following crossover from PGSQL
Posted by: Vince Gatto
Date: December 16, 2008 12:50PM

The wildcard for LIKE is %, not *, so your query should be this:

select * from detail where oid like '00000001%';


While I don't know this for sure, it could be that when you use a full text index on this data, MySQL is treating periods as word delimiters, and breaking your IP address up into four words. The default minimum word size for a full text index is four characters, so its likely only the last part (000/24) is making it into the index, and then only if the / character is not also a word delimiter.

Since IP addresses and ranges are clearly numeric data, you may want to consider using a numeric data type instead of varchar. And you clearly don't want to be using a full text index here. This isn't MySQL specific, the same goes for PGSQL.

Options: ReplyQuote


Subject
Views
Written By
Posted
9408
December 16, 2008 09:44AM
Re: Confusion following crossover from PGSQL
5522
December 16, 2008 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.