Yes, you are right.
Seems I forgot about columns' order when I've been written this patch.
I'm not sure about what kind of columns' order should be preferable in theory, but I've made a some kind of benchmark with both orders of columns in index and have found no differences in performance.
There were 100 005 resources with 3 kind of TVs for each and the query were:
```sql
SELECT
COUNT(DISTINCT modResource.id)
FROM
modx_site_content modResource
JOIN
modx_site_tmplvar_templates tv_tmpl
ON
modResource.template = tv_tmpl.templateid
JOIN
modx_site_tmplvars tv
ON
tv.id = tv_tmpl.tmplvarid
LEFT JOIN
modx_site_tmplvar_contentvalues tvr
ON
tvr.tmplvarid = tv_tmpl.tmplvarid
AND tvr.contentid = modResource.id
```
Thanks for inspective review.

P.S.: You could see another mistake of such kind in core/model/schema/modx.sqlsrv.schema.xml