Efficiently finding elements with 0 has_many elements?

[prev] [thread] [next] [Date index for 2005/04/22]

From: dglasser
Subject: Efficiently finding elements with 0 has_many elements?
Date: 14:35 on 22 Apr 2005
Say I have a class Item and a class Data; each Item has_many Data, and
each Data has_a Item.

Is there an efficient way to find the rows of Item which have no Data?
I can do a retrieve_all on Item and iterate through them looking for
which ones have an empty $item->data, but it seems like I ought to be
able to do this operation in the database.

--dave

Efficiently finding elements with 0 has_many elements?
dglasser 14:35 on 22 Apr 2005

Generated at 09:29 on 27 Apr 2005 by mariachi v0.52