Quantcast
Viewing all articles
Browse latest Browse all 3160

Improve the performance of research in large data sets

On a WPF application already in production, users have a window where they choose a client. It shows a list with all the clients and a TextBox where they can search for a client.

As the client base increased, this turns out to be exceptionally slow. Around 1 minute for a operation that happens around 100 times each day.

Currently mssql management studio says the query select id, name, birth_date from client takes 41 seconds to execute (around 130000 rows).

Is there any suggestions on how to improve this time? Indexes, ORMs or direct sql queries on code?

Currently I'm using framework 3.5 and LinqToSql

If your query is actually SELECT id, name, birth_date from client (ie, no where clause) there is very little that you'll be able to do to speed that up short of new hardware. SQL Server will have to do a table scan to get all of the data. Even a covering index means that it will have to scan an index just as big as the table.

What you need to ask yourself is: is a list of 130000 clients really useful for your users? I anybody really going to scroll through to the 75613th entry in a list to find the user that they want? The answer is probably not. I would go with the search option only. At least then you can add indices that make sense for those queries.

If you absolutely do need the entire list, try loading it lazily in chunks. Start with the first 500 records and then add more records as the user moves the scroll bar. That way the initial load time is reduced and the user will only load the data that is necessary.


Viewing all articles
Browse latest Browse all 3160

Trending Articles