Using small integers instead of entire class strings for morph relations can improve their performance
- ·
- Telegram
- ·
- Newsletter
When using Laravel morphs, you can eek out some extra performance by using small integers instead of strings for your morph types.
Smaller, faster indexes for the database to manage!
Especially useful for tables like comments or audits, which can be many millions of rows.