Which operations a database needs written another way (PLAN §11.4), as the engine's plan for it gets them wrong: the database rejects the SQL, or the SQL takes the wrong rows

interface CubeDialectWorkarounds {
    distinct: boolean;
    drop: boolean;
    limit: boolean;
    slice: boolean;
}

Properties

distinct: boolean

Distinct padded with a column, so it keeps its own query: the engine writes a distinct then a limit as select top N distinct, which SQL Server rejects, or numbers a limit's rows inside the select distinct, which then removes nothing (Sybase IQ)

drop: boolean

Drop through row numbers: for a Drop inside a query, the engine writes limit m,-1, which SQL Server, Sybase and DB2 reject, or numbers the rows itself by the first sort key only (Sybase IQ, MemSQL), or after a descending key writes nulls firstoffset m, one word (ClickHouse)

limit: boolean

Limit through row numbers: in a subquery, the engine numbers a limit's rows itself, by the first sort key only, in a column it always names row_number (Sybase IQ), so ties on that key take any rows and an input column of that name clashes

slice: boolean

Slice through row numbers: for a Slice inside a query, the engine writes limit m,n, which SQL Server and Sybase reject, or numbers the rows itself by the first sort key only (Sybase IQ)