Massive performance issues with list control populated from SQL

  • 5 December 2017
  • 1 reply
  • 71 views

Hi folks,

 

maybe someone has an idea for me:

I call a subform with three views.

On two of these views I have list controls (auto-complete). 5 list controls in total.

These need to be populated depending on a parameter of the subform.

 

So in the initalize rule I populate the list controls with the parameter as input value.

The results are correct, the list controls populate as expected.

 

The issue is, that this takes ages.

I'm talking up to more than a minute load time for a form with just those 5 list controls and a button on the third view.

 

The data for the list controls is coming from SQL tables (one per list control).

The SQL-Server itself does not show performance issues.

The tables are not big, the biggest one maybe 10000 items, no more.

 

What I've tried:

  1. Executing the rules in a batch - no difference
  2. Executing the rules asynchronously - the loading icon is not shown this long but the fields are not populated any faster. When trying to select a list control, it freezes until the population is finished.
  3. Isolation the population of the list controls and executing them in a different rule - no difference.
  4. Using Live Search - I can't seem to define the input value that way. So the speed is much better, but the result is wrong.

Tihs is really problematic!

 

System: K2 4.7 August 2017 Cumulative Update

 

Thanks in advance and take care,
Alex


1 reply

Badge +6

Hi AlexS,


 


I suspect the reason things are slow is because the auto-complete control is loading ALL the data/columns from the SQL tables which is likely slow to load or slow to get parsed when it gets the to the form.  You can confirm this using the browser debugger when loading the form.


 


You can try populate the auto-complete control using an input property/filter when the control is changed (i.e. when a user types a value to auto-complete):


 


In a"when Autocomplete is changed event" - contains a value rule, add a 'Populate a list control with data' rule.  Configure the input mappings of this rule with the Auto-complete Text as the property being 'auto-completed' e.g. if it is a person's 'Name' property being auto-completed, link the autocomplete text to the 'Name' property as input.  This will populate the control with data only matching the text displayed/typed into the Autocomplete control and will only fire when the text in the control is changed.  For the Autocomplete 'Data Source', change the Display to the 'Name' property only. This is because the property is used as ithe display text filter.


Remember to disable the populate list control in the form initialization rule.


 


Another option would be to use the picker control but that kinda works the same was as the workaround I suggested above i.e. the loading of the data happens at a later stage with an input property/filter.


 


HTH!

Reply