[support] Database : why the type fields are varchars

Earnest Berry III earnest.berry at gmail.com
Tue Apr 3 16:10:46 UTC 2007


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 at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Chris Johnson
Sent: Tuesday, April 03, 2007 10:30 AM
To: support at 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070403/46a25c48/attachment.htm 


More information about the support mailing list