The Road to 2.18 - Customfields

Sean McAfee etzwane at schwag.org
Fri Mar 12 21:14:00 UTC 2004


David Miller <justdave at bugzilla.org> wrote:
>On 3/12/2004 2:53 PM -0500, Daniel Berlin wrote:
>> Well, Sean obviously has a working implementation of this.
>> Sean, how many bugs does your install have?
>> What is performance like on your database for queries against multiple
>> custom fields?

>Last I heard, he doesn't have query implemented yet.

Not implemented?  It's practically the crown jewel of my patch.

Here's a message I posted back in October that describes it:

http://bugzilla.org/cgi-bin/mj_wwwusr?user=&passw=&list=developers&brief=on&func=archive-get-part&extra=200310/17

Our installation has, let's see...1760 bugs.  Here's a little program I just
wrote to gauge query performance:

----------------------------------------
#!/usr/bin/perl

use Bugzilla::CustomFields::Query;
use strict;

do 'globals.pl';

@ARGV > 0 && @ARGV % 3 == 0
    or die "usage: $0 field op value [ field op value ... ]\n";

my @where;

for (my $i = 0; $i < @ARGV; $i += 3) {
    push @where, [ @ARGV[ $i, $i+1, $i+2 ] ];
}

my $count = 0;

my $iterator = bug_iterator(where => \@where, custom_fields => 0);

while (my $bug = $iterator->()) {
    ++$count;
}

print "$count bugs found.\n";

----------------------------------------

I ran this program several times with progressively more query terms.

"short_desc" is the short description from the BUGS table.

bash-2.05a$ time ./count-bugs.pl short_desc allwords Astro
344 bugs found.

real	0m1.037s
user	0m0.713s
sys	0m0.068s

tlc_incident_num is an integer field; querying against it introduces a join
against the CF_INTEGER table.

bash-2.05a$ time ./count-bugs.pl short_desc allwords Astro tlc_incident_num '>=' 2700
117 bugs found.

real	0m0.834s
user	0m0.717s
sys	0m0.053s

tlc_platform_serial_num is a short string field; querying against it
introduces a join against the CF_SHORTSTRING table.

bash-2.05a$ time ./count-bugs.pl short_desc allwords Astro tlc_incident_num '>=' 2700 tlc_platform_serial_num allwords 'n/a'
21 bugs found.

real	0m0.801s
user	0m0.689s
sys	0m0.059s

tlc_reproducibility_details is a long string field; querying against it
introduces a join against the CF_LONGSTRING table.

bash-2.05a$ time ./count-bugs.pl short_desc allwords Astro tlc_incident_num '>=' 2700 tlc_platform_serial_num allwords 'n/a' tlc_reproducibility_details allwords happens
10 bugs found.

real	0m0.813s
user	0m0.701s
sys	0m0.053s


It would appear that the differences in times in all three of the later
cases are just noise.  In any case, no significant performance hit is
evident.


--Sean



More information about the developers mailing list