1. A method comprising: receiving, via an application programming interface of a model optimizer having an optimizer framework, data comprising at least one optimization rule; registering the at least one optimization rule for execution by a rules engine of the optimizer framework; receiving a query; generating an initial data flow graph comprising a plurality of nodes for executing the query; optimizing the initial data flow graph using the rules engine; and initiating executing of the query using the optimized data flow graph.