04-26-2020, 04:15 PM
Because this is a dynamically calculated value done in python, you cannot search or order by it. It would have to calculate the value for this to be possible. For this to be efficient it would have to either be a column or an aggregate table (or more recently, we use have started to standardize a jsonb column called "data" on all stypes) that contains this kind of information. The values are calculated on a change trigger or some external script (run daily for example). At this point, it can be ordered or searched for.