We need to find another way to solve this. Doing a full table scan, returning ALL the data (including full XML fields) and throwing it away is definitely not a long-term solution.

Is there a way to reliably split a softwareid in regid part and uniqueid part, and then query for the two things separately?

If not, other possibilities might be filtering by [extra fields](https://docs.djangoproject.com/en/dev/ref/models/querysets/#extra) or doing a raw query. The problem is that unless there's a standardized concat syntax this does not work across different database engines, so we'd have to write multiple versions of the same query and filter by engine. That's quite ugly.