[rt-users] Slow query on CFs

Thomas Sibley trs at bestpractical.com
Tue Jun 4 10:47:02 EDT 2013


On 06/04/2013 06:03 AM, Vegard Vesterheim wrote:
> A RT (TicketSQL) query like this:
> 
> Queue = 'drift' AND (  Status = 'new' or Status = 'open' or Status =
> 'stalled' ) AND (  CF.{utstyr} = 'ufisaweb.uninett.no' OR CF.{utstyr} =
> 'dss2.uninett.no' OR CF.{utstyr} = 'myrhauk.uninett.no' OR CF.{utstyr} =
> 'angel.uninett.no' OR CF.{utstyr} = 'jatoba-esxi2.uninett.no' OR
> CF.{utstyr} = 'bold.uninett.no' OR CF.{utstyr} = 'nidar.uninett.no' OR
> CF.{utstyr} = 'voll.uninett.no' OR CF.{utstyr} = 'brekka.uninett.no' OR
> CF.{utstyr} = 'www.stroemme.no' OR CF.{utstyr} = 'xen.uninett.no' OR
> CF.{utstyr} = 'jatoba-kvm4.uninett.no' OR CF.{utstyr} =
> 'inventory.uninett.no' OR CF.{utstyr} = 'busy.uninett.no' OR CF.{utstyr}
> = 'ufisa.uninett.no' OR CF.{utstyr} = 'wildfire.uninett.no' OR
> CF.{utstyr} = 'newfire.uninett.no' OR CF.{utstyr} = 'fou1.uninett.no' OR
> CF.{utstyr} = 'kanari.uninett.no' OR CF.{utstyr} = 'dok.uninett.no' OR
> CF.{utstyr} = 'ebony-kvm5.uninett.no' OR CF.{utstyr} =
> 'jatoba-kvm12.uninett.no' )

I'm sure you've considered this, but I have to ask: Could you simplify
most of the CF conditions with CF.{utstyr} ENDSWITH '.uninett.no'?

For a technical solution, the approach Ruslan described is the way to
go.  It works great for watchers.



More information about the rt-users mailing list