Database: small sorting optimization
Remove unnecessary sort operations when extracting linear features