Yes, joining on a text field is slow in any DB, and searching “slower” in any db also. That said, I don’t believe the “type” field is used in any join.

 

Further, this is just something inherent in Drupal, the “type” field being a varchar. It would take some core patching to enumerate the field. One say to fix this is to do just that though, have the DB “enumerate” the field internally; that kind of gets harry though, depending on your db because you’ll have to alter/update the field whenever a “type” is created and/or removed. But that’s a solution to that issue that I can think of off the top of my head.

 

I know from my own experience integer field is much faster, I’d dare to say twice as fast as an integer field.

 

- Souvent22


From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Chris Johnson
Sent: Tuesday, April 03, 2007 10:30 AM
To: support@drupal.org
Subject: Re: [support] Database : why the type fields are varchars

 

It all depends on what one means by "slow" I suppose.   If slow simply means "slower than integers," then he's probably right, regardless of the database.