I believe it's due to the query for "next" that has the coalesce; not sure if something can be done about that (index on function?).
Postgres seems unhappy with such an index... needs research.
> * create index qidx_multi on jqstore_managed_job (priority desc, coalesce(now(), START_DTS) asc, job_id asc);
ERROR: functions in index expression must be marked IMMUTABLE
I believe it's due to the query for "next" that has the coalesce; not sure if something can be done about that (index on function?).
Postgres seems unhappy with such an index... needs research.