Develop > Tailoring Best Practice Guide > Queries > How do I write a good query?

How do I write a good query?

An ideal Service Manager query has the following characteristics.

  • Runs against indexed columns to avoid full table scans. See Indexing.
  • Uses operators like equal to ( = ) that map well to SQL to avoid full table scans. See Query operators.
  • Avoids RAD functions like index() that are likely to cause full table scans. See Function usage.
  • Ensures that variables always have a non-null value. See Variable usage and null values.