Index field of c3 type in descending order


#1

Can we index a c3 type using the db annotation based on descending values of a field.

E.g. instead of doing @db(index=[‘start’]) can we do @db(index=[‘descending(start)’]) ?

Does it even make sense?


#2

Any love on this one? We have several occurrences in a source system where a descending index is used (oracle) and I’m looking for something like this in the platform.


#3

@romain.juban and @clowtown Yes you can do what Romain did in his example. However, for a single column index, such as this, it really doesn’t need to be there as Postgres can use indexes just as efficiently backwards. However, if there is a multi part index where you want a single column in the opposite direction, it would be useful. For example, something like:

@db(index=[parent, descending(timestamp)])

might help for some queries.