Hello. All.
It’s a draft for testing only.
Problems:
- All this about perfomance.
- DBIx::SearchBuilder fetch all fields from target table. We can
reproduce this at ticket history when ticket contain large binary
attachments. Their content fetched within first request, but never used. - DBIx::SearchBuilder have no info about table structure so don’t know
field list.
Solution:
Attached patches against
rt3.0.8pre2
DBIx::SearchBuilder 0.94
solve 2) and 3) in one way.
This patches are easy to understand:
-
New function ‘FetchFields’ in DBIx::SearchBuilder class which should
return list of fields to prefetch while filling collection of records.
By default return [’*’].
Caveat: list must include ‘id’ field. -
Functions which update {‘values’} hash of record instance also update
{‘fetched’} hash. -
__Value function changed to check {‘fetched’} hash and fetch field
from DB if it’s needed. -
To _ClassAccessible hash added attribute ‘noprefetch’. That used when
Record loaded not via LoadFromHash(means external source
DBIx::SearchBuilder). -
Several other changes. It’s easier to look in path. I know perl
better then English
Why RT changed?
-
RT::CurrentUser: _Accessible converted to _ClassAccessible.
As I’ve understood _Accessible is deprecated. Code don’t work if class
don’t have _ClassAccessible sub. I can fix it I think. -
Features are implemented in RT::Attachments.
-
RT/Ticket_Overlay.pm have some strange field ‘Requestors’, that don’t
have mirror in DB. I think it should be eliminated. It’s minor ‘bug’.
Questions:
-
Reasons for keeping _ClassAccessible in Overlays?
-
Why sometime id skipped there?
-
Comments? Suggestions? I can maintain and improve this patches only
if there is any sanity chance to include it main code in other case I
just throw them away.RT is good. I want to see RT on first place
Ruslan.
noprefetch.patch (5.64 KB)
noprefetch_rt.patch (4.24 KB)