Connector speed issue

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
shadowmaan
Posts: 2
Joined: Thu 10 Jan 2013 14:08

Connector speed issue

Post by shadowmaan » Thu 10 Jan 2013 14:10

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Connector speed issue

Post by Shalex » Fri 11 Jan 2013 16:32

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'")

shadowmaan
Posts: 2
Joined: Thu 10 Jan 2013 14:08

Re: Connector speed issue

Post by shadowmaan » Fri 11 Jan 2013 20:11

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

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Connector speed issue

Post by Shalex » Mon 14 Jan 2013 07:53

The TOP N will be faster than the same select without TOP N.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Connector speed issue

Post by Shalex » Tue 29 Jan 2013 17:36

Please use LIMIT N instead of TOP N.
E.g.: SELECT Name FROM Account LIMIT 5

Post Reply