I have a C# WinForms application with SQL express DB,
I have a table contains 20 columns and 2 lacks records, the table having 6 indexes 1 is clustered index and 5 are a non clustered index.
in 5 indexes 3 columns are varchar datatype and 1 column is bit and 1 is a numeric datatype.
My Application scenario is
we have 2 Application and PC both the pc running different applications and accessed single DB located at PC 1-
both the applications running continuously and hit on DB for "UPDATE" records and sometimes "SELECT" some record.
We have no concern about update statement, but whenever application hit select query then sometimes application takes more time than normal, I have very much concern about the select statement result. below is my query which is called from a stored procedure.
SELECT Count(PrimaryKey) as CNT From Tabel where Col1 ="AAAAAAAA"
and (Col2 =0 OR Col2 is null) and Col3 =0
Most of the times the SP given result in 1 or 2 milliseconds but sometimes it takes 45,60, 90,189, 260 e.t.c millisecond, which not useful for my applications
I am facing this issue at second PC which is remotely accessed DB though LAN.
The execution time has been confirmed by application logs which maintained by my application and through SQL Profiler.
My expected result is in 1 to 30 millisecond not more than 30,
Please help me on this for getting consistent time result.
Thank you so much in advance.
Thanks,
Sagar Kerlekar.