I know I could use real SQL db (am already using it for other apps) but 
that it not the question here.
This is really small, single form, PopUp App that only reads some data from 
this sheet, and they want to keep it this way for now.
I am just curious if this Query can be improved ?

On Saturday, March 28, 2015 at 3:10:45 PM UTC+1, Olaf Stolle wrote:
>
> Du solltest lieber auf SQL DB umsteigen oder XML, die fusiontabels sind 
> auch schneller, das geht schneller
>
> Liebe grüße
>
> Olaf
>
> 2015-03-28 14:45 GMT+01:00 Boris Djurdjevic <[email protected] 
> <javascript:>>:
>
>> 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] <javascript:>", 
>> "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] 
>> <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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