Cdbauthmanager Table Structures

Hi everybody,

I recently started using the CDbAuthManager and noticed that it uses text fields for the relations between tables. AFAIK that is considered bad practise as it can cause severe performance issues. Any specific reason text was chosen over (the more common) numbers?



Probably for easier debugging and to avoid introducing a constant for every auth item what would be necessary to keep your code readable.

Using text shouldn’t create too much overhead in the database unless you use ridiculous amount of auth items, but then iterating over a tree would be a far bigger concern than text FKs.

If you’re still curious about efficiency, read this article about text primary keys in PostgreSQL.