[support] impact of converting db varchars to integers

Gerhard Killesreiter gerhard at killesreiter.de
Wed Apr 4 13:26:12 UTC 2007


-----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-----


More information about the support mailing list