Discussion about this post

User's avatar
Andrew Jones's avatar

Thanks for sharing! 🙌 Just ran it on one of our GCP projects. Potentially a few thousand dollars a year we can save 💸

Expand full comment
Jens Tonberg Larsson's avatar

Run at own risk, but it's pretty cool that you can wrap the query above in:

FOR resulting_row IN (

... the query with a filter to only include rows that save cost ...

) DO EXECUTE IMMEDIATE(resulting_row.command); END FOR;

to actually apply the command directly with the query. I find scripts like above quite powerful and potentially dangerous :)

Expand full comment
1 more comment...

No posts