29. Advanced Developer Boot Camp 29
SELECT column_names
FROM table_joins
WHERE conditions
SELECT column_names
FROM table_joins
WHERE ROWNUM <= @maxrows AND conditions
Change to
SELECT column_names
FROM table_joins
WHERE conditions
SELECT TOP @maxrows column_names
FROM table_joins
WHERE conditions
Change to
SELECT column_names
FROM table_joins
WHERE conditions
SELECT column_names
FROM table_joins
WHERE conditions
LIMIT maxrows
Change to
31. Advanced Developer Boot Camp 31
SELECT column_names
FROM table_joins
WHERE conditions
ORDER BY order_by_list
SELECT Count(1)
FROM Simplified_table_joins
WHERE conditions
Adapt to
43. Advanced Developer Boot Camp 43
Same conditions evaluated per column, and according to the
result a query is made individually per cell
Solution #1:
Make the decision in the preparation to perform a different specialized query, joining
with the required tables and returning the same Output structure.
Solution #2:
Implement 2 or more specialized screens and make the decision to call the correct
screen, in situations where the conditional content outweighs common content
46. Advanced Developer Boot Camp 46
In this example, GetInConditionsCounters computes two IN conditions that
are injected in query GetCounters to avoid complex sub-queries inside
GetCounters
Although more complex to code, in terms of efficiency it is better to implement
the sub-queries and let the DB Engine optimize the entire query
60. Advanced Developer Boot Camp 60
Screen preparation is faster because data preparation is made in each webblock.
Use caching mechanisms when repeating the same action/query on different webblocks