Seagate ST43401N/ND Información técnica Pagina 76

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 172
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 75
5-22 Implement: Making Required Application Changes
If Your Current Version is 4.x, 10.x, or 11.0.x Adaptive Server Enterprise 11.5
Avoid mathematical manipulation of indexed columns when
using search arguments. For example, do not use mathematical
functions on the column itself, as shown in the example. Instead,
perform the function against the constant on the other side of the
operator.
Don’t:
select name from employee
where salary * 12 > 100000
Do:
select name
from employee
where monthly_salary > 100000 / 12
Avoid use of any function against the indexed column(s) on the
“left” side of the operator.
Avoid incompatible datatypes in column names, search
arguments, or stored procedure parameters. Keep datatypes
consistent throughout an application or server. Incompatible
datatypes include:
- float and integer
- char NOT NULL and varchar
- binary and varbinary
However, integer and intn (allows NULLs) are compatible
Multiple
or clauses. or clauses are expensive for these reasons:
- If any portion of the
or clause requires a table scan, the whole
query will use table scanning.
-
or clausesrequire creating and sorting a work table
Consider using
unions as an alternative.
Use
group by instead of using distinct without aggregates. This
reduces the size of the worktable created and, by storing distinct
values only in the
group by worktable, reduces the processing
resources needed to sort them.
Don’t:
select DISTINCT ship_to_address
from customer_orders
where last_order_date >= "01/01/1997"
Do:
Vista de pagina 75
1 2 ... 71 72 73 74 75 76 77 78 79 80 81 ... 171 172

Comentarios a estos manuales

Sin comentarios