[FLOW3-general] Getting all Values of some Objects Property

Karsten Dambekalns karsten at typo3.org
Fri Jan 22 11:00:58 CET 2010


Hi.

On 21.01.10 13:17, marc neuhaus wrote:
> I was wondering how i would accomplish something equivalent to this:
>     "SELECT date FROM posts GROUP BY date;"

So, what you want is
 SELECT DISTINCT date FROM posts
(should be cheaper than grouping). Anyway, that doesn't matter here. :)

> My first idea was to get All Objects through findAll() an iterate over all
> of them and compiling an array of the Used Properties:

Right.

> Problem with this is, that this would take way to long if there are lots of
> $posts.

Probably. Think about your use case, how would you handle this in a
world without RDBMS'? Think about your data structure ad try to find a
way to model that efficiently.

> Is this the only way to do something like this at the moment?

Yes.

> Is something planned/specified to provide a better way to retrieve something
> like this?

Well, the problem is, we provide object persistence. If you receive
single properties, you no longer deal with objects, and what good is the
list of dates without relation to any objects? (Probably you simply
chose a bad example...)

Grouping and joins are another example where the we-are-used-to-it
problem clashes with the new paradigms. What do you get from two objects
if you join them? How do you group objects like in SQL?

All that said, lazy loading will come back in FLOW3, this could help
with the performance problem you expect in the loop-solution. And we'll
try to find a way to do something like that what you need - if it makes
sense we might even integrate it :). If that happens it could be
something like the way JSR-283 describes table-like views on nodes.

Regards,
Karsten


More information about the FLOW3-general mailing list