This is true, but I'm wondering if it's worth it with the trade-offs you're forced to make. Generally you want some sort of spatial hierarchy structure to make frustum/occlusion culling viable, so if you're traversing a structure like that it doesn't seem convenient to batch meshes by sorting their texture ids.
You also benefit by sorting front-to-back when rendering opaque objects, since doing so will cause more hidden fragments to fail the depth test and be skipped entirely. I'd be interested to know which optimization is more useful.
Wouldn't you want to sort through which objects you _want_ to render, then sort by shader/textureID? I've yet to develop a system like this so you could be right.