friendica/friendica — pull request #208 by campino (2012-04-05 11:52:13+00:00)
Title: An Index for config and pconfig

Please note: This commit was done on my windows machine. So it changed a whole bunch of file permissions... Please let me know if you don't want to pull that into main line. In this case I fix it as soon as I'm back to my linux computer.

In config and pconfig pairs of cat and k values are unique. There are never two values for the same category and key.
This can be used to have an index on it on the database schema.
Benefits are:
(1) mysql ensures they actually are unique, we don't need complex logic in php to do so. Instead, REPLACE can be used. This means one db query less on every config change.
(2) Access to the table by cat, k is faster.

I doubt we will actually experience the second one. The tables aren't that big, but the first one pays for me.