1

Sometimes I have problems with Work With Plus regarding grids when I try to sort by the values ​​of a column. The SQL database that provides that data does not have an index on that column, but most of the time it is pretty quick to give me an answer also because the records are not very many, but in some cases I cannot identify the sorting is a lot slow and loads even more than a minute. Anyone know where this problem could be coming from? At the moment I work with genexus 17U6, WWP 14 3.2, but the problem also occurs in the past in other projects

Nicola
  • 209
  • 1
  • 8

1 Answers1

0

You can use the GeneXus log to a file (https://wiki.genexus.com/commwiki/servlet/wiki?36304,Log+level+property), and then run the slow program and analyze where the delay in execution is occurring. There you can see the slow sentence and optimize it in the database. You should have to reduce the number of records that the query is returning.

You can also enable the SQL Server Profiler, for slow statements or those that consume many resources.

ealmeida
  • 444
  • 3
  • 11
  • I will try, but the error is not easily replicable as it happens at irregular intervals in the same object, it is not a specific one that has this problem – Nicola Jul 13 '22 at 12:21
  • As far as I know when WWPlus is used the Genexus code created uses "conditional filters and orders" (https://wiki.genexus.com/commwiki/servlet/wiki?12566,Conditional%20Orders%20and%20Filters). So, SQL sentences could vary depending on the filters/orders selected by the user (runtime) and "SQL execution plan" could vary accordingly. – Guscarr Jul 13 '22 at 14:00
  • As the previous answer suggest, you should see if this problem happens when some type of filter applied. Maybe the performance problem is not related to the sort and the applied filters are causing it. Using the log will really help to understand the SQL query that is being executed, and how to optimize it. – Sofia Maiolo Jul 13 '22 at 19:27
  • @Nicola, The causes of the slowness of a web page can be diverse. You should find a way to reproduce the slowness and then try to solve it. Running it many times with log/trace enabled may help. If the delay comes from another part of the infrastructure (slow network, latency, slow javascript component, disk, memory, cpu, database locks, etc) it may be a bit more difficult to detect. You may have to use monitors from your infrastructure to detect it. – ealmeida Jul 14 '22 at 14:54