1. 18

  2. 4

    If you’d like to try it on your live production database

    Good one :-)

    1. 2

      Is this something Amazon could easily patch out of their query compiler?

      What’s the generally accepted way of optimizing CPU-bound queries without injecting assembly code- would it be splitting a query into multiple ones: Query pt1 -> do some CPU -> Query pt2?

      1. 3

        He appears to be exploiting the fact that the extension to allow embedded python functions in postgres (and redshift) is unsafe, and able to execute arbitrary code.

        Of course, you could also simply write the chess engine in python (rather than in C++ injected into python), or whatever extension language is available. That would undoubtably be slower, but it would just as easily saturate the CPU.

        In other words, if you write custom functions that thrash, Amazon’s unlikely to be able to prevent that thrash. Same as if you thrash an EC2 instance, or any other cloud service that allows code execution.