Hello,

I think you can use a fulltext index and a regex:

select * from table where match( ftfield) against ('+interests +reading' in boolean mode) and ftfield rlike your regexp
or
select * from table where match( ftfield) against ('+interests +reading' in boolean mode) having ftfield rlike your regexp


Remember that fulltext words must have 4+ char (but you can change it in my.cnf file).

Santino

At 21:14 -0600 7-10-2004, Elim Qiu wrote:
?Hi, instead of xml, i stored arbitrary data of the form
(the actual usage of such mechanism is for more fancy stuff,
say, dynamic configuration, otherwise this is really not necessary)

{
name = "Fn, Ln"; // string value
gender = F; // single word string
interests = (reading,"drive fast"); // array
children = (
{ lastName = Howe; firstName = Sam; gender = M; dob = "1994-10-07 16:59:26"; },
{ lastName = Howe; firstName = Ann; gender = F; dob = "1998-01-26 04:09:12"; }
);
creditCards = {
visa = "XXXXXXXXXXX-xxxxx";
master = "YYYYYYYYYY-yyyy";
};
}


This is called plist and the depth of the hierarchy can go arbitrary deep (unknown limit). And it can be converted back
and forth from dictionary object by a framework.


My task is to find out ways of querying a column holds such text data? say, find out whether there is certain key or
whether a key has certain value. I got some solution via regular expression feature of MySQL.


The column type that I use is text. My question now is how to make the whole thing perform good. In other words,
for regular expression querying, should I index the column for performance? If so, what kind of index should I use?


Thanks a lot.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to