Use extents table for ms sql layers for faster loading

- Also move feature count logic