Re: where url = 'x' with url a TEXT field

2006-09-28 Thread Peter Van Dijck

Thanks.. the problem is I'm running MySQL 4.1.16

I might try FULLTEXT...

On 9/27/06, Dan Buettner [EMAIL PROTECTED] wrote:

You can create FULLTEXT indexes on text fields - but that may not be
the best solution for your situation since you are querying for an
exact match.

In MySQL 5.0.3 and later, you can create VARCHAR columns of up to
65,535 character lengths:
http://dev.mysql.com/doc/refman/5.0/en/char.html

I seem to recall you were asking about storing URLs up to the
practical limit, 2083 characters.  I've never used a varchar column
that long before; I'm not sure what the performance implications might
be, or how effective a database index on a field that length would be.

Still, worth a try.  Could be that it will work smashingly.

HTH,
Dan

On 9/27/06, Peter Van Dijck [EMAIL PROTECTED] wrote:
 Hi,
 since urls can be longer than 255 chars, I made the url field a TEXT field.

 The problem is, I can't make an index on it, so doing 'WHERE
 url='xxx'' becomes a very sloow query.

 Any ideas for solutions? Am I mistaken in the idea that I can't make
 an index on a TEXT field?

 Thanks!
 Peter

 --
 Find 1s of videoblogs and podcasts at http://mefeedia.com
 my blog: http://poorbuthappy.com/ease/
 my job: http://petervandijck.net

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






--
Find 1s of videoblogs and podcasts at http://mefeedia.com
my blog: http://poorbuthappy.com/ease/
my job: http://petervandijck.net

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



Re: where url = 'x' with url a TEXT field

2006-09-28 Thread Wagner, Chris (GEAE, CBTS)
Peter Van Dijck wrote:
 
 Thanks.. the problem is I'm running MySQL 4.1.16
 
 I might try FULLTEXT...

U can create normal indexes on text columns if u specify a prefix
length.


-- 
Chris Wagner
CBTS
GE Aircraft Engines
[EMAIL PROTECTED]

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



Re: where url = 'x' with url a TEXT field

2006-09-27 Thread Douglas Sims
I think you have to specify a key length when you use an index on a  
text field...


mysql alter table t2 add index i2(t1(3));

That would create an index (called i2) on the first 3 characters of  
field t1 of table t2.


I think that's right?

Douglas Sims
[EMAIL PROTECTED]



On Sep 27, 2006, at 8:53 PM, Peter Van Dijck wrote:


Hi,
since urls can be longer than 255 chars, I made the url field a  
TEXT field.


The problem is, I can't make an index on it, so doing 'WHERE
url='xxx'' becomes a very sloow query.

Any ideas for solutions? Am I mistaken in the idea that I can't make
an index on a TEXT field?

Thanks!
Peter

--
Find 1s of videoblogs and podcasts at http://mefeedia.com
my blog: http://poorbuthappy.com/ease/
my job: http://petervandijck.net

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



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



Re: where url = 'x' with url a TEXT field

2006-09-27 Thread Dan Buettner

You can create FULLTEXT indexes on text fields - but that may not be
the best solution for your situation since you are querying for an
exact match.

In MySQL 5.0.3 and later, you can create VARCHAR columns of up to
65,535 character lengths:
http://dev.mysql.com/doc/refman/5.0/en/char.html

I seem to recall you were asking about storing URLs up to the
practical limit, 2083 characters.  I've never used a varchar column
that long before; I'm not sure what the performance implications might
be, or how effective a database index on a field that length would be.

Still, worth a try.  Could be that it will work smashingly.

HTH,
Dan

On 9/27/06, Peter Van Dijck [EMAIL PROTECTED] wrote:

Hi,
since urls can be longer than 255 chars, I made the url field a TEXT field.

The problem is, I can't make an index on it, so doing 'WHERE
url='xxx'' becomes a very sloow query.

Any ideas for solutions? Am I mistaken in the idea that I can't make
an index on a TEXT field?

Thanks!
Peter

--
Find 1s of videoblogs and podcasts at http://mefeedia.com
my blog: http://poorbuthappy.com/ease/
my job: http://petervandijck.net

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




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