Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
411 B
2
Indexable
Never
CREATE OR REPLACE VIEW public.workflow_detail_view AS
SELECT 
    ... -- (existing columns)

    instance_family,
    CASE 
        WHEN instance_family = 'serverless'::text THEN GREATEST(instance_size::integer / 16, 1) * 4
        WHEN instance_size ~ '\d'::text THEN regexp_replace(instance_size, '[^\d]'::text, ''::text, 'g'::text)::integer * 4
        ELSE 0 
    END AS instance_cores

FROM workflow_v2 wv;
Leave a Comment