1. Saul Erhmy
  2. .NET DataStore
  3. Friday, 14 October 2022 18:34 PM UTC


Is there a way to speed up how fast dataStore.Retrieve() retrieves all rows? Or can i split up the Retrieve() in some sort of way using multithreading. For example this is what I'm thinking, could I get the count of all rows, split it up N times, and then do a retrieve for each N. If possible what is the best way to speed up a Retrieve? 

edit: it seems I can RetrieveByPage(3, 10) which would get me rows 3 to 10. But how could I find the max row count? In other words I need to prevent the end parameter from going out of bounds and the only way to do this is to find what the max row count is. dataStore.Retrieve() will give my the max row count but that would defeat the purpose of what I am trying to accomplish. 

p.s Sorry for more questions :)

Tracy Lamb Accepted Answer Pending Moderation
  1. Tuesday, 18 October 2022 17:20 PM UTC
  2. .NET DataStore
  3. # 1

In many of my datawindows, I just put a rowcount() check, and ask the user if they want to continue after 250 rows...

DW's rowretrieve event:

// Increment the row counter
// Notify user every 250 rows...
integer li_Response
if ib_cancel then
		this.Event ue_set_menu()
	return 1							// Cancel the Query
end if

if il_rowcounter = 250 then
	li_response = MessageBox("Retrieve","250 rows have been retrieved." &
									 + "~Continue?",Question!, YesNo!, 2)
	if li_response = 1 then  		// Continue the Query
		il_RowCounter = 0
		return 0						
	else								// Cancel the query
		this.Event ue_set_menu()
		return 1						
	end if
end if

The dw's retrievestart event sets il_rowcounter to 0.



  1. Olan Knight
  2. Tuesday, 18 October 2022 22:59 PM UTC
Like you and Tracey, I have also experienced pain with slow retrievals. In response I created a "Retrieval Threshold Service" and added it to the PFC's u_dw code.


I get the expected rowcount, and I have a variable loaded with the maximum number of rows allowed before asking the user if they would like to continue. I also have a progress meter with a CANCEL button on it that still stop the retrieval at the point the CANCEL button is pushed. As each multiple of the variable max_count is reached, I prompt the user if they would like to continue.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.