Could you add a comment about why you are casting to text and then backcasting to geography?

Could you add a functional index for GeomAsText(location) as use that instead of postgres casting?