On Jan 10, 2008 2:49 PM, John Mettraux <[EMAIL PROTECTED]> wrote:
> (recapitaluting a bit)
>
> So we have 3 possibilities
>
> a). attributes are stored in one column of the workitem table
> b). attributes are stored in the field table (current implementation)
> c). tree of attributes in the field table
>
> a).
> + faster at read/write
> - have to load all the workitems to query on fields
> b).
> - slower at read/write
> + can do queries on top level attributes
> c).
> - super slow
> + can do queries on attributes at all levels (except maybe on sub
> fields whose keys are not strings)
>
> Is that it ?
>
> (seems like we both don't like variant c). but do we see it the same way
> ?)
>
Completely
>
> I like 1 as well, because it allows admins to change their mind later
> and choose another behaviour. But that would mean that the Workitem /
> Field classes are able to answer to queries, even when having a
> heterogeneous set of workitems.
>
To be able to "wi has a field named x?" when saving and updating wis, we
can make this:
wi.attributes = ifw.attributes
wi.field_keys = (ifw.attributes.keys.collect { |x| x.to_s }).join( " " )
# a supplemetary TEXT column
so that
select workitems.* from workitems where field_keys LIKE PATTERN
should be fine,
uses more disk space and it's not one of the best pieces of code ever
written but should work ( and further this may be an idea to dump all the
attributes "key paths" to this suppementary field.... so that one can also
make "recursive searches" at once)
WDYT?
> We could use variant 2 and have a rake task to migrate workitems to
> the without field version and vice et versa.
>
>
It's possible, but i don't like this too much.
>
> What do you think ?
>
> --
> John Mettraux -///- http://jmettraux.openwfe.org
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/openwferu-dev?hl=en
-~----------~----~----~----~------~----~------~--~---