Why is tenant_id the last field in the (fysically) generated index?

I noticed that in the database, the tenant_id is generated as the last field in the index.
To me it seems more logical to have the tenant_id as the first field of the composite index.
Is there a reason the field tenant_id isn’t the first field in the (fysically) generated indexes?

Hi Eric,

That's a good question, and the only thing that comes to  my mind is that the tenand_id has relatively lower selectivity (kinda, but not exactly the same as less variation) meaning it's probably less useful than the other columns in the index.

Note that the DB engine might not actually use the index if it determines it has a low selectivity, so putting lower selectivity columns at the end of the index is probably a good idea.

Or maybe I'm overthinking it, and it's just because they had to put it somewhere, and figured putting it at the end was easier. :)