Reputation: 71
I want to post about 150 different regions on the page. But this page is loaded for 10 seconds, I divided them into tabs by 10 regions in the tab, but it did not help, the page loads for a very long time, can I make it so that it would not load the entire page, but only those regions that are in the current tab ?? Thanks for the help) Each region has an Interactive Report type! My qwery in regions(The only difference is the "where" parameter for each region) In this code, I use color gradation to highlight each temperature with its own color
select
v.NAME_LVL,
max(h.temp) as max_temp_lvl1,
min(h.temp) as min_temp_lvl1,
CASE WHEN max(h.temp) <= 5 THEN 'data-style="background-color:rgb(0,0,255)"'
WHEN max(h.temp) >= 5 and max(h.temp) <= 6.2 THEN 'data-style="background-color:rgb(0,143,255)"'
WHEN max(h.temp) >= 6.2 and max(h.temp) <= 7.1 THEN 'data-style="background-color:rgb(0,39,255)"'
WHEN max(h.temp) >= 7.1 and max(h.temp) <= 8 THEN 'data-style="background-color:rgb(0,71,255)"'
WHEN max(h.temp) >= 8 and max(h.temp) <= 9.2 THEN 'data-style="background-color:rgb(0,102,255)"'
WHEN max(h.temp) >= 9.2 and max(h.temp) <= 10.1 THEN 'data-style="background-color:rgb(0,142,255)"'
WHEN max(h.temp) >= 10.1 and max(h.temp) <= 11.3 THEN 'data-style="background-color:rgb(0,174,255)"'
WHEN max(h.temp) >= 11.3 and max(h.temp) <= 12.2 THEN 'data-style="background-color:rgb(0,218,255)"'
WHEN max(h.temp) >= 12.2 and max(h.temp) <= 13.1 THEN 'data-style="background-color:rgb(0,244,255)"'
WHEN max(h.temp) >= 13.1 and max(h.temp) <= 14.0 THEN 'data-style="background-color:rgb(0,255,237)"'
WHEN max(h.temp) >= 14.0 and max(h.temp) <= 15.2 THEN 'data-style="background-color:rgb(0,255,206)"'
WHEN max(h.temp) >= 15.2 and max(h.temp) <= 16.1 THEN 'data-style="background-color:rgb(0,255,167)"'
WHEN max(h.temp) >= 16.1 and max(h.temp) <= 17.0 THEN 'data-style="background-color:rgb(0,255,135)"'
WHEN max(h.temp) >= 17.0 and max(h.temp) <= 18.2 THEN 'data-style="background-color:rgb(0,255,102)"'
WHEN max(h.temp) >= 18.2 and max(h.temp) <= 19.1 THEN 'data-style="background-color:rgb(0,255,64)"'
WHEN max(h.temp) >= 19.1 and max(h.temp) <= 20 THEN 'data-style="background-color:rgb(0,255,32)"'
WHEN max(h.temp) >= 20 and max(h.temp) <= 21.2 THEN 'data-style="background-color:rgb(0,255,0)"'
WHEN max(h.temp) >= 21.2 and max(h.temp) <= 22.1 THEN 'data-style="background-color:rgb(39,255,0)"'
WHEN max(h.temp) >= 22.1 and max(h.temp) <= 23 THEN 'data-style="background-color:rgb(71,255,0)"'
WHEN max(h.temp) >= 23 and max(h.temp) <= 24.2 THEN 'data-style="background-color:rgb(102,255,0)"'
WHEN max(h.temp) >= 24.2 and max(h.temp) <= 25.1 THEN 'data-style="background-color:rgb(142,255,0)"'
WHEN max(h.temp) >= 25.1 and max(h.temp) <= 26 THEN 'data-style="background-color:rgb(174,255,0)"'
WHEN max(h.temp) >= 26 and max(h.temp) <= 27.2 THEN 'data-style="background-color:rgb(206,255,0)"'
WHEN max(h.temp) >= 27.2 and max(h.temp) <= 28.1 THEN 'data-style="background-color:rgb(244,255,0)"'
WHEN max(h.temp) >= 28.1 and max(h.temp) <= 29 THEN 'data-style="background-color:rgb(255,237,0)"'
WHEN max(h.temp) >= 29 and max(h.temp) <= 30.2 THEN 'data-style="background-color:rgb(255,206,0)"'
WHEN max(h.temp) >= 30.2 and max(h.temp) <= 31.1 THEN 'data-style="background-color:rgb(255,167,0)"'
WHEN max(h.temp) >= 31.1 and max(h.temp) <= 32 THEN 'data-style="background-color:rgb(255,135,0)"'
WHEN max(h.temp) >= 32 and max(h.temp) <= 33.2 THEN 'data-style="background-color:rgb(255,102,0)"'
WHEN max(h.temp) >= 33.2 and max(h.temp) <= 34.1 THEN 'data-style="background-color:rgb(255,64,0)"'
WHEN max(h.temp) >= 34.1 and max(h.temp) <= 35 THEN 'data-style="background-color:rgb(255,32,0)"'
WHEN max(h.temp) >= 35 THEN 'data-style="background-color:rgb(255,0,0)"'
ELSE NULL
END css_style_max,
CASE WHEN min(h.temp) <= 5 THEN 'data-style="background-color:rgb(0,0,255)"'
WHEN min(h.temp) >= 5 and min(h.temp) <= 6.2 THEN 'data-style="background-color:rgb(0,143,255)"'
WHEN min(h.temp) >= 6.2 and min(h.temp) <= 7.1 THEN 'data-style="background-color:rgb(0,39,255)"'
WHEN min(h.temp) >= 7.1 and min(h.temp) <= 8 THEN 'data-style="background-color:rgb(0,71,255)"'
WHEN min(h.temp) >= 8 and min(h.temp) <= 9.2 THEN 'data-style="background-color:rgb(0,102,255)"'
WHEN min(h.temp) >= 9.2 and min(h.temp) <= 10.1 THEN 'data-style="background-color:rgb(0,142,255)"'
WHEN min(h.temp) >= 10.1 and min(h.temp) <= 11.3 THEN 'data-style="background-color:rgb(0,174,255)"'
WHEN min(h.temp) >= 11.3 and min(h.temp) <= 12.2 THEN 'data-style="background-color:rgb(0,218,255)"'
WHEN min(h.temp) >= 12.2 and min(h.temp) <= 13.1 THEN 'data-style="background-color:rgb(0,244,255)"'
WHEN min(h.temp) >= 13.1 and min(h.temp) <= 14.0 THEN 'data-style="background-color:rgb(0,255,237)"'
WHEN min(h.temp) >= 14.0 and min(h.temp) <= 15.2 THEN 'data-style="background-color:rgb(0,255,206)"'
WHEN min(h.temp) >= 15.2 and min(h.temp) <= 16.1 THEN 'data-style="background-color:rgb(0,255,167)"'
WHEN min(h.temp) >= 16.1 and min(h.temp) <= 17.0 THEN 'data-style="background-color:rgb(0,255,135)"'
WHEN min(h.temp) >= 17.0 and min(h.temp) <= 18.2 THEN 'data-style="background-color:rgb(0,255,102)"'
WHEN min(h.temp) >= 18.2 and min(h.temp) <= 19.1 THEN 'data-style="background-color:rgb(0,255,64)"'
WHEN min(h.temp) >= 19.1 and min(h.temp) <= 20 THEN 'data-style="background-color:rgb(0,255,32)"'
WHEN min(h.temp) >= 20 and min(h.temp) <= 21.2 THEN 'data-style="background-color:rgb(0,255,0)"'
WHEN min(h.temp) >= 21.2 and min(h.temp) <= 22.1 THEN 'data-style="background-color:rgb(39,255,0)"'
WHEN min(h.temp) >= 22.1 and min(h.temp) <= 23 THEN 'data-style="background-color:rgb(71,255,0)"'
WHEN min(h.temp) >= 23 and min(h.temp) <= 24.2 THEN 'data-style="background-color:rgb(102,255,0)"'
WHEN min(h.temp) >= 24.2 and min(h.temp) <= 25.1 THEN 'data-style="background-color:rgb(142,255,0)"'
WHEN min(h.temp) >= 25.1 and min(h.temp) <= 26 THEN 'data-style="background-color:rgb(174,255,0)"'
WHEN min(h.temp) >= 26 and min(h.temp) <= 27.2 THEN 'data-style="background-color:rgb(206,255,0)"'
WHEN min(h.temp) >= 27.2 and min(h.temp) <= 28.1 THEN 'data-style="background-color:rgb(244,255,0)"'
WHEN min(h.temp) >= 28.1 and min(h.temp) <= 29 THEN 'data-style="background-color:rgb(255,237,0)"'
WHEN min(h.temp) >= 29 and min(h.temp) <= 30.2 THEN 'data-style="background-color:rgb(255,206,0)"'
WHEN min(h.temp) >= 30.2 and min(h.temp) <= 31.1 THEN 'data-style="background-color:rgb(255,167,0)"'
WHEN min(h.temp) >= 31.1 and min(h.temp) <= 32 THEN 'data-style="background-color:rgb(255,135,0)"'
WHEN min(h.temp) >= 32 and min(h.temp) <= 33.2 THEN 'data-style="background-color:rgb(255,102,0)"'
WHEN min(h.temp) >= 33.2 and min(h.temp) <= 34.1 THEN 'data-style="background-color:rgb(255,64,0)"'
WHEN min(h.temp) >= 34.1 and min(h.temp) <= 35 THEN 'data-style="background-color:rgb(255,32,0)"'
WHEN min(h.temp) >= 35 THEN 'data-style="background-color:rgb(255,0,0)"'
ELSE NULL
END css_style_min
from HANGINGTHREAD_SILO a
left join IOT_DEVICES b on b.ID = a.DEVICES_ID and b.ORGANIZATION = a.ORGANIZATIONS
left join SILO_SENSOR v on v.DEVICES_ID = b.outguid and v.ORGANIZATIONS = b.ORGANIZATION
left join TEMPR_SILO h on h.name = v.NAME and h.ORGANIZATIONS = v.ORGANIZATIONS
left join SILO z on z.id = a.ID_SILO
where TRIM(z.name) = TRIM('1201') and z.ORGANIZATION = 181
group by
z.name ,
v.NAME_LVL
ORDER BY v.NAME_LVL desc
<!-- begin snippet: js hide: false console: true babel: false -->
Upvotes: 0
Views: 399
Reputation: 4659
For posterity... I met with the user online to get a better idea of the problem they were trying to solve. Each of the 150+ regions on the page was using the same query with a different set of values in the where clause. While visually attractive, the performance hit of running so many queries on the same page - and the fact that each region had to be maintained individually - was too much.
I suggested using a single Interactive Report with Control Breaks on the field that was previously used to group individual regions. This solution performed perfectly and had the benefit of leveraging all of the other features of Interactive Reports, such as filtering (instead of using tabs to show groups of regions), charts, and more.
Upvotes: 1
Reputation: 621
I think you really need to ask yourself....why are you loading 150 regions on the same page. What is the business need for this? Why would a user need to see all 150 regions on the same page at the same time?
If I were you, I would break up the page. This is information overload for the end user (and, seemingly cluttered).
Upvotes: 0