QA1008: GetCurrentTicks

This advisor message is returned when a query uses the GetCurrentTicks function in a WHERE clause. The message clarifies the reason and provides guidance to improve query performance.

Properties

Value
RuleID QA1008
Title GetCurrentTicks
Category Performance

Cause

The query uses GetCurrentTicks in the WHERE clause.

Rule Description

The function GetCurrentTicks doesn't utilize the index and can cause higher RU charge and slower query performance.

Recommendation

Consider using GetCurrentTicksStatic instead, which utilizes index and is deterministic. For more information on GetCurrentTicksStatic, see GetCurrentTicksStatic.

Example

Original query:

SELECT * 
FROM c 
WHERE c.timestamp > GetCurrentTicks()

Revised query:

SELECT * 
FROM c 
WHERE c.timestamp > GetCurrentTicksStatic