impact of converting db varchars to integers
Hi, . To improve Drupal performance, our client has suggested to change the field types from varchars to integers in some tables. A few tables with varchar fields are as follows: node : type permissions : perm node_access : realm blocks_roles : module (It means we are numbering node types from node/comment/page/story to 1/2/3/4..... like that) I guess i need to change the drupal core code as well - if i change the core tables field types. I would like to know whether this is feasible or not. And what would be the impact, if i change the data types of the core tables. Thanks & Regards, T.Melantias
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 melantias toomaate schrieb: Please watch your mailheader, there is absolutely no sense in sending you mail to more than one mailing list.
Hi, . To improve Drupal performance, our client has suggested to change the field types from varchars to integers in some tables.
Quite frankly: There are other areas which lend themselves to easier performance gains.
A few tables with varchar fields are as follows:
node : type
See below
permissions : perm
I don't think this make a lot of sense.
node_access : realm
That might make sense, as there are actually selects on realm. But realms are created dynamically by modules, so a numbering scheme would need a sequence in the database...
blocks_roles : module
There is a select on that. I doubt it would makr much of a difference unless you have 100rds of blocks.
(It means we are numbering node types from node/comment/page/story to 1/2/3/4..... like that)
And what do you do with dynamically created node types?
I guess i need to change the drupal core code as well - if i change the core tables field types. I would like to know whether this is feasible or not.
I think it isn't the best idea.
And what would be the impact, if i change the data types of the core tables.
Probably rather close to 0. I'd simply create two tables and to a million selects on them and then see what the difference is. Don't forget to switch off the query cache. Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGE6d0fg6TFvELooQRAj5vAJ9aVnaWYPxNAdAfdjwQnYs8NP8mHACgkxaI cX7bJiHI4C25cqhOHO3sCdY= =5LxU -----END PGP SIGNATURE-----
To improve Drupal performance, our client has suggested to change the field types from varchars to integers in some tables.
This isn't really the list for that sort of discussion. For the technical aspects of doing so, and whether it's a viable approach, you really want to ask on the development list, not the support list. However, you'd really have to provide benchmarks that showed an amazing improvement in performance. IE., how does your client have any sort of clue that this is actually a good thing? Are they just waxing poetic about things they think they know something about, but don't? -- Morbus Iff ( tomorrow never comes until it's too late ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ aim: akaMorbus / skype: morbusiff / icq: 2927491 / jabber.org: morbus
On Wed, 04 Apr 2007 10:07:45 -0400, Morbus Iff <morbus@disobey.com> wrote:
To improve Drupal performance, our client has suggested to change the field types from varchars to integers in some tables.
This isn't really the list for that sort of discussion. For the technical aspects of doing so, and whether it's a viable approach, you really want to ask on the development list, not the support list.
However, you'd really have to provide benchmarks that showed an amazing improvement in performance. IE., how does your client have any sort of clue that this is actually a good thing? Are they just waxing poetic about things they think they know something about, but don't?
Well, joins on integer fields are faster than varchar fields. Whether they're enough faster to justify the loss in flexibility/readability/debugability that would come from it I don't know, but I doubt it. Again, though, this should be on the dev list if anywhere. --Larry Garfield
participants (4)
-
Gerhard Killesreiter -
Larry Garfield -
melantias toomaate -
Morbus Iff