Ruutert
Ruutert

Reputation: 395

fastest way to sort database records

I have a datatable with approx. 5000 records and put it in a dataset/datatable what's the fastest way to sort these ?

Upvotes: 0

Views: 1515

Answers (2)

Nix
Nix

Reputation: 58562

Assuming you have a real database server, and the database is correctly indexed, the fastest way to do it would be to push the sort down to the database.

If you assume everything is runing on your laptop, I would still take an indexed sort over an in-memory sort(linq).

Upvotes: 5

Barry Kaye
Barry Kaye

Reputation: 7759

I would always perform a sort like this in the database.

Upvotes: 1

Related Questions