database - Will "where `id` in (...)" be comparable in performance with common "where" statement? -


the title tells all.

let's say, have separate class, serves query processor in dsl. is, feed query in dsl, , runs query.

this query processor talk whatever database connector library use , extract only ids of records matching criteria.

this... let's "sets", of ids fed class actual orm on database , constructs domain objects records having ids.

this way not need include query parsing abilities orm mechanics , have totally dumb method fetch records ids.

as addition, let's suppose have types of caching imaginable, starting web page cache down dbms query cache.

will scheme have bad performance compared traditional building of (sql or, maybe, mongodb-style) queries , running them on database directly?

i understand require 2 queries per fetch operation, instead of one. question magnitude of difference.

my overall goal separate interface queries interface of actual objects gotten queries. example, yii's cactiverecords fail @ it, being combination of 3 different responsibilities merged together.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -