What's the difference between ElementCriteriaModel and DbCommand? Forgive me if this is a stupid or naive question...

I generally think of an ElementCriteriaModel as being a "search object". Specifically, it's a search object which revolves around a specific type of element. The model has attributes like order, offset and limit, which are obviously common terms when conducting an SQL query.

On the other hand, a DbCommand is an object which directly translates to an SQL query. This is far more flexible, allowing you to do things like perform complex joins.

So while I can certainly see some differences, it's hard for me to grasp the finer points of one vs. the other. (I'll admit that typing this has helped me to see it a little more clearly.)

What am I missing/misunderstanding?
DbCommand represents a SQL statement to execute against a database.

ElementCriteriaModel is a model just like any other model in craft/app/models, but it also happens to make it easy to search for Elements in the database.

By setting all of the criteria for the elements you're searching for and calling the find() method, that will invoke craft()-&gt;elements-&gt;findElements($this);, which in turn will create a DbCommand object custom built for the ElementCriterialModel parameters that you set.

So think of ElementCriteriaModel as an abstraction on top of DbCommand that makes it easy to search for Elements.