Generating a good execution plan for a declarative query has long been a central problem in data management research. With the rise in interest in wireless sensor networks (WSNs) as query processing platforms, it was quickly noticed that the corresponding optimization problem is even more challenging than the classical one, since, in comparison to classical platforms, a WSN is a very constrained computational infrastructure (in terms of memory, processing, and communication capabilities, and, crucially, depletable energy stocks). Optimizing a declarative query for execution in WSNs is thereby made both more important and more challenging. One of the requirements for effective query optimization is the availability of effective models for estimating the cost of alternative execution plans. This paper describes how query cost models for space, time and energy were methodically derived and validated for an expressive algebra for continuous queries over sensor streams.