I have one Spreadsheet(as small online database) with several worksheets on 
it, which I query on demand to check for changes.
I initialize every ListQuery only once at startup:

        SpreadsheetsService = new SpreadsheetsService("Spreadsheet-test");
SpreadsheetsService.setUserCredentials("[email protected]", "pass");

SpreadsheetQuery spreadsheetQuery = new SpreadsheetQuery();
SpreadsheetFeed = SpreadsheetsService.Query(spreadsheetQuery);

string spreadsheetTitle = "test";
SpreadsheetEntry spreadSheet = 
(SpreadsheetEntry)SpreadsheetFeed.Entries.SingleOrDefault(a => a.Title.Text 
== spreadsheetTitle);

AtomLink link = 
spreadSheet.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, 
null);
WorksheetQuery worksheetQuery = new WorksheetQuery(link.HRef.ToString());
WorksheetFeed worksheetFeed = SpreadsheetsService.Query(worksheetQuery);

string sheetTitleOne = "One";
string sheetTitleTwo = "Two";
string sheetTitleThree = "Three";

ListQuery listQueryOne = null;
ListQuery listQueryTwo = null;
ListQuery listQueryThree = null;

foreach (var worksheet in worksheetFeed.Entries)
{
AtomLink listFeedLink = 
worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
ListQuery listQuery = new ListQuery(listFeedLink.HRef.ToString());

if (worksheet.Title.Text == sheetTitleOne)
listQueryOne = listQuery;
else if (worksheet.Title.Text == sheetTitleTwo)
listQueryTwo = listQuery;
else if (worksheet.Title.Text == sheetTitleThree)
listQueryThree = listQuery;
}


and then query them on request:

ListFeed listFeedOne = (ListFeed)SpreadsheetsService.Query(listQueryOne);

ListFeed listFeedTwo = (ListFeed)SpreadsheetsService.Query(listQueryTwo);

ListFeed listFeedThree = 
(ListFeed)SpreadsheetsService.Query(listQueryThree);

Every query here takes minimum 0.3 second even if worksheet contains only 
one row.
I have about 10 worksheets so it is 3 seconds, which is too slow because I 
need all 10 worksheets in under 1 second so user don't notice any delay.
For example worksheets with 1000 rows load in 1.7 second which is OK 
because it's large.
But I don't understand why loading only few rows isn't faster and how can 
it be increased.
Can I somehow load several sheet simultaneously or is there some other way 
to do this.
Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to