[Rt-devel] Optimizing _BuildItemMap / ItemsArrayRef in Tickets_Overlay.pm

Gene Hsu rt at hsufarm.com
Tue Apr 26 15:14:43 EDT 2005


On Tue, Apr 26, 2005 at 02:06:53PM -0400, Jesse Vincent wrote:
> 
> On Tue, Apr 26, 2005 at 10:43:51AM -0700, Gene Hsu wrote:
> > I was wondering how one would go about optimizing _BuildItemMap found in
> > Tickets_Overlay.pm.
> > 
> > One thing that it does on an unrealistic test database that has 10,000 
> > results for a search query is that it loads each row into memory and sorts
> > them.  Then _BuildItemMap only keeps the ticket id's.  This isn't bad, but
> > for 10,000 tickets, with about 4k/row, that's 40MB of information that 
> > needs to be transferred from the database.
> 
> What's your realistic test case?

Probably on the order of 1000 tickets.  That's only 4MB, but that still 
takes time.

> > 
> > Can _BuildItemMap be written such that it doesn't use ItemsArrayRef and
> > uses a custom SQL query that pulls down only the ticket ids, instead?
> > 
> > -- Gene

-- Gene


More information about the Rt-devel mailing list