Support > Repository > Tuning > Performance tuning
ja | en

You can improve performance problems by devising model design.

problem

List boxes and radio buttons provided by Wagby are not suitable for selecting large amounts of data.From the operability of the user interface, it can be said that the number displayed on the screen as an option is 100 or less.

If this list box (or radio button) is designed as a hidden item and designed to hold more than 100 data, internally a large amount of SQL will be issued to prepare choices.In model definitions that contain many such items, performance will be problematic as the data volume of the choices increases.

Figure 1 List Box with Large Number of Choice

solution

Model reference items with a large number of choices are not list boxes and radio buttons,Search screenPlease define as.In particular, if you originally set it as a hidden item, it will not affect the appearance.

Since "search screen" does not prepare option information beforehand, it can reduce the number of SQL issue.

problem

Wagby provides two definition methods as a narrowing-down method for list boxes etc. in the registration/update screen.

In the [a] method, once all the option data is acquired from the database, it narrows down.Therefore, it is unsuitable when you have a large number of options.

Since the [b] method narrows down using the where clause of SQL, even if there are a lot of choices, performance problems are less likely to occur.

Figure 2 Example in which the option of "person in charge of our company" changes when designating "department in charge of our company"

solution

If the number of choices is large, we recommend using [b] method.

problem

Explain model A as an example referring to model B.Here, model B is assumed to be a model for master use.

When repeating containers, checkbox items, etc. are defined in the referenced model (B), all these items of model B are read using SQL at the timing of referring to the model from model A.However, on the model A side, this SQL processing is unnecessary if you know not to use these items.

Figure 3 When join is required for another table

For example, if "Data change historyLet's assume that we hold "In many cases, however, models that refer to this do not use change history information.However, from the viewpoint of performance, it is not preferable from the viewpoint of performance because it always manipulates repeating containers (this is another table) which holds the change history of data at the timing of accessing the referenced model.

solution

Prepare a submodel that holds only the minimum necessary items in the referenced model.

Figure 4 Main model and submodels

In the submodel, you define only the minimum items that are used for model reference such as primary key, nonreference item, display priority item, invalidation judgment item, narrowed down item.From this reference model, you can suppress unnecessary processing by using this submodel.

problem

It is possible to design such that Wagby's model refers to this view by preparing a view in the external database beforehand.

Figure 5 Refer to view

If the data of the view is updated irregularly here, concern is raised that Wagby's model cache mechanism displays past data.for that reasonDisable model cacheAlthough it can issue, since it issues SQL every time reference is made to the model, it will cause performance degradation.

solution

Please consider the following method.

  1. Wagby's model cache is enabled, and cache information is periodically erased using jobs.
  2. Use "materialized view" provided by the database.

For details, see "Model definition> Use viewsPlease read.

On the detail screenAccess data before and afterYou can prepare the button.

Wagby's general screen operation is (1) search (2) list display (3) detailed display. Here, the button for accessing the data before and after will grasp the data before and after himself, using the retrieval result obtained in the process of displaying the list in (2).

If you go directly to (3) detailed display screen without taking this step, we will rewrite the list data internally.Therefore, it takes time to display the detailed screen.

You can improve the display performance of detailed screens by disabling the buttons that access the previous and next data.(By default, this function is enabled.)