I have 8.000 or 16.000 products on my list in an sql table. It takes 8 or 16 secs to find the last item.
How could I make the search faster? Indexing? But how?
I created:
createTable1.CommandText = "Create TABLE products (ID int IDENTITY(0,1) PRIMARY KEY, name ntext)"
and I use simple WHERE to search.
Thank you!What is your searh criteria?|||
Hi,
The ID column in the Products table being a primary key is already indexed. If you are peforming a search using the 'name' column in the where clause, indexing could help.
However indexes are not supported for ntext data types. You will need to alter the datatype of the column to allow indexing.
This link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlce/htm/_lce_create_index.asp provides details on index creation for SQL CE
If you are using the same query with different values in the where clause, using compiled parametrized queries will definitely improve performance.
This link http://msdn2.microsoft.com/en-us/library/ms172984.aspx provides details on performance tuning for SQL Mobile.
No comments:
Post a Comment