I'm new at using pervasive, and it does not run correctly for me.
and I down't seems to get the data as fast as I shut.
I down know how I can make it better, i have made a small test using the ADO.Net from the parvasive site.
I'm using the 3.0 version, ADO.net file.
I'm using psql 10.13.
I want to test how long time it take to loop through 10.000 call's to the database.
here is my code
//Start the timer
DateTime now = DateTime.Now;
// Create a pervasive connection.
pConnection = new PsqlConnection("ServerName=xx.xx.xx.xx;dbq=xxxxxxxx;");
// Create a SQL statement
string sSQL = "select * from picture where pictureid = 57750";
// Create a pervasice command
PsqlCommand pCommand = new PsqlCommand(sSQL, pConnection);
// Open Connection
// Loop the action
for (int i = 1; i < 10000; i++)
// Create and get pervasive dataReader
pDataReader = pCommand.ExecuteReader();
// Get the result
// Get value
Response.Write("PictureID: " + pDataReader["pictureid"].ToString());
// Close the DataReader
// Close connection
// Stop the timer, and write the result.
Response.Write("Result : " + (DateTime.Now - now).ToString());
Time result of this test is: 00:01:04.7657910
And I think this is a warry long time for selecting from a database.
if I make the same code just to a Sql component instead of a psql component and a mssql database then my result is: 00:00:04.0720000
I think there is a big difference.
is there anyone who can tell me what I should do to optimize this?
First, comparing PSQL to MSSQL is not a valid comparison. If you call Pervasive and try to compare performance with MSSQL, they will not make any guarantees on performance.
Second, 1 minute for 10,000 query executions is pretty good.
Third, if you really want to make sure you're optimized there's a few things to check.