1. A computer-implemented method comprising: receiving, by a distributed database system from a client device, a query; generating, by the distributed database system, a first query plan for computing query results for the query from compressed data, wherein the first query plan includes one or more first decompress operators that are applied to data in compressed form to generate data in decompressed form, wherein the first query plan specifies that the one or more first decompress operators are executed before a particular operator that is a root operator of the first query plan; determining that the first query plan is logically equivalent to a second query plan that replaces the one or more first decompress operators with a second decompress operator that is a root operator of the second query plan; in response, generating a third query plan that eliminates the second decompress operator and that specifies execution of decompress operations on the client device; and obtaining compressed query results from the database using the third query plan; and providing the compressed query results to the client device in response to receiving the query.