Page 1 of 1

Connector speed issue

Posted: Thu 10 Jan 2013 14:10
by shadowmaan
Hi;

I'm using the following snippet of code for testing. It takes ~30s to run.
The select returns ~32,000 rows. If I limit number of rows by using TOP 100
in the select the execution time remains the same.

Code: Select all

connection.Open();
int count = 0;

using (SalesforceCommand command = connection.CreateCommand())
{
	command.CommandText = "SELECT Company, Status, CreatedDate FROM Lead";

	sw.Start();
	using (SalesforceDataReader reader = command.ExecuteReader())
	{
		string value;
		while (reader.Read())
		{
			value = reader.GetString(0);
			++count;
		}
	}
	sw.Stop();
}
Retrieving the same data directly from the salesforce.com using the browser
takes just a few seconds.

I tried the CacheAll option, which looks promising, but then the first execution,
while the data is not in the cache yet, takes ~50s which is not acceptable.

I wonder if there is a way on improving the speed of the connector?

Re: Connector speed issue

Posted: Fri 11 Jan 2013 16:32
by Shalex
shadowmaan wrote:If I limit number of rows by using TOP 100 in the select the execution time remains the same.
Thank you for your report. dotConnect for Salesforce ignores the TOP N statement currently. We will notify you when the issue is fixed.
shadowmaan wrote:Retrieving the same data directly from the salesforce.com using the browser takes just a few seconds.
Our provider will retrieve data fast after the fix.
shadowmaan wrote:I wonder if there is a way on improving the speed of the connector?
Assuming that you are using "Cache All=True", please try the following approach.
Employ Connection.Cache.Alter() for the tables which contain a lot of data: http://www.devart.com/dotconnect/salesf ... ng%29.html. This will add a filter to limit the amount of cache data for the Lead table:
connection.Cache.Alter("Lead", "CreatedDate >= '2012-10-20' and CreatedDate <= '2012-10-25'")

Re: Connector speed issue

Posted: Fri 11 Jan 2013 20:11
by shadowmaan
Shalex wrote:Our provider will retrieve data fast after the fix.
Are you saying the overall performance of the provider increases or just the TOP N will be faster than the same select without TOP N?

Sincerely,
Igor

Re: Connector speed issue

Posted: Mon 14 Jan 2013 07:53
by Shalex
The TOP N will be faster than the same select without TOP N.

Re: Connector speed issue

Posted: Tue 29 Jan 2013 17:36
by Shalex
Please use LIMIT N instead of TOP N.
E.g.: SELECT Name FROM Account LIMIT 5