[rt-devel] First try of noprefetch.

Ruslan U. Zakirov cubic at acronis.ru
Tue Dec 23 10:18:10 EST 2003


		Hello. All.
It's a draft for testing only.

Problems:
1) All this about perfomance.
2) 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.
3) 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:
1) 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.

2) Functions which update {'values'} hash of record instance also update 
{'fetched'} hash.

3) __Value function changed to check {'fetched'} hash and fetch field 
from DB if it's needed.

4) To _ClassAccessible hash added attribute 'noprefetch'. That used when 
Record loaded not via LoadFromHash(means external source 
DBIx::SearchBuilder).

5) Several other changes. It's easier to look in path. I know perl 
better then English :)

Why RT changed?
1) 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.

2) Features are implemented in RT::Attachments.

3) 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:
1) Reasons for keeping _ClassAccessible in Overlays?
2) Why sometime id skipped there?
3) 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noprefetch.patch
Type: application/aegis-patch
Size: 5778 bytes
Desc: not available
Url : http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20031223/f67e44d8/noprefetch.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noprefetch_rt.patch
Type: application/aegis-patch
Size: 4342 bytes
Desc: not available
Url : http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20031223/f67e44d8/noprefetch_rt.bin


More information about the Rt-devel mailing list