Re: [rt-users] Backing up RT

2011-01-05 Thread Andy Graybeal

We use mysqldump and logrotate to keep a week of DB dumps on the local
filesystem, we perform daily backups to a VTL and then tape, and we also
perform nightly SAN snapshots on the RT host's LUN (making sure to lock
the databases before the snapshot, and then unlocking after so the MySQL
DB files are in a consistent state during the snap).


Wow, you have a complicated system.  I was considering backing up the 
whole machine with LVM snapshots, but I don't think I have the space 
overall to deal with full machine snapshots.


If I ever ended up doing LVM snaps, do I need to lock the db first... 
or can I get away with not locking the db with LVM snaps?


You use logrotate to manage your mysqldumps!  Excellent idea.
I need to learn logrotate.  I was wondering how I can keep mysqldumps 
from each day and not lose control of them.  I'm excited.


Thank you for your response.  (I need to google VTL)

-Andy


Re: [rt-users] Backing up RT

2011-01-05 Thread Andy Graybeal

This is exactly what I do.  Is this a decent way to be doing it -- I've
always just assumed it was okay.  I do it hourly, and then SCP it to
another system.

Should I be stopping mysql or anything  before doing the mysqldump?
--


Max,
What made you do hourly dumps?   I'm thinking now instead of nightly, I 
should be doing hourly dumps like you.


-Andy


[rt-users] Browser (Firefox) does not save username and passwords

2011-01-05 Thread Obando, David DE - EV
Hi all,

I'm about to migrate an old RT 3.6.3 setup to a new v3.8.8 machine. 
On the new installation, login data (user and password) are not stored
by the browser. On my old 3.6.3 version this works and I also want this
behaviour in the new version.
I already change the code (Elements/Login) and removed the
autocomplete=off parameter, but browser behaviour does not change.

Any ideas?


Thanks and best regards,
David


Re: [rt-users] Backing up RT

2011-01-05 Thread Konstantin Khomoutov
On Tue, Jan 04, 2011 at 06:27:24PM -0600, Max McGrath wrote:

 *I run a nightly dump as root:
 
 mysqldump --opt rt3 -u root -p  rt3.sql
  (assuming the root user can perform that dump)
 
 Then scp the file to another system.
 
 Since the rest of the system doesn't change much, I don't bother with much
 of anything else.  I have a snapshot of the whole system (my RTs are VMs
 under VirtualBox, so they're easy to backup (single file)).*
 *
 *
 This is exactly what I do.  Is this a decent way to be doing it -- I've
 always just assumed it was okay.  I do it hourly, and then SCP it to another
 system.
 
 Should I be stopping mysql or anything  before doing the mysqldump?
--opt locks all the tables in a given database before backing it up so
that only reads can be done on it. This is for MyISAM engine, for
engines supporting ACID there's more effective option available --
bother to read mysqldump man page.

If you think preventing read access to the db during backup affects the
RT performance (but you should really measure the dump time first),
you can look at mysqlhotcopy script (MyISAM only) which trades speed for
disk space.



[rt-users] Custom field queries are very slow after 3.8.8 upgrade (from 3.6.10)

2011-01-05 Thread Georgi Georgiev
I am looking for some advice on how to speed up some queries using
custom fields that got unusably slow after an upgrade from the RT 3.6 series
to 3.8.

We are currently running RT 3.6.10 on CentOS 5.5 with a postgresql
back end (used to be PgSQL 8.1 but we upgraded to 8.4 when CentOS 5.5
came out). The RT package is from EPEL and everything is fine.

When trying to upgrade to RT 3.8.8 some of our saved queries using
custom fields get very, *very* slow. I tried this twelve months ago with
RT 3.8.7 on CentOS 5.x and PgSQL 8.1 (whatever was current then), and
also again today, on RHEL6 with PgSQL 8.4.

The problematic queries look something like this:

Queue = 'somequeue' AND Status = 'stalled' AND (
'CF.{MyCF}' = 'value1' OR
'CF.{MyCF}' = 'value2' OR
'CF.{MyCF}' = 'value3' OR
'CF.{MyCF}' = 'value4' OR
'CF.{MyCF}' = 'value5' OR
'CF.{MyCF}' = 'value6' OR
'CF.{MyCF}' = 'value7' )

where the listed values are 3-4 characters long and their number varies.

After the ugprade, and with logging of slow queries enabled, I saw these
numbers for queries with 5, 6, 7, and 8 OR statements for the custom
field in the postgresql logs:
- query for 5 possible CF values - 0.6 seconds
- query for 6 possible CF values - 6 seconds
- query for 7 possible CF values - 65 seconds
- query for 8 possible CF values - 681 seconds

In comparison, the corresponding query in RT 3.6 executes in less than 2
milliseconds.

One thing I noticed is that the SQL that is generated by RT 3.6 and 3.8
is substantially different.

In 3.6 there is a single SELECT on the ObjectCustomFieldValues table, so
the generated SQL looks like this:

SELECT DISTINCT main.*
FROM Tickets main
JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
AND ( ObjectCustomFieldValues_1.Disabled = '0' )
AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
WHERE (main.Status != 'deleted')
AND (main.Queue = '11' AND main.Status = 'stalled' AND
(
 ( ( ObjectCustomFieldValues_1.Content = 'value1' )  )
 OR  ( ( ObjectCustomFieldValues_1.Content = 'value2' )  )
...
)
)
AND (main.Type = 'ticket')
AND (main.EffectiveId = main.id)
ORDER BY main.id ASC

In RT 3.8.8 the generated SQL looks like this:

SELECT DISTINCT main.*
FROM Tickets main
LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
AND ( ObjectCustomFieldValues_1.Disabled =  '0' )
AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_2
ON  ( ObjectCustomFieldValues_2.CustomField = '1' )
AND ( ObjectCustomFieldValues_2.ObjectType = 'RT::Ticket' )
AND ( ObjectCustomFieldValues_2.Disabled =  '0' )
AND ( ObjectCustomFieldValues_2.ObjectId = main.id )

WHERE (main.Status != 'deleted')
AND (
main.Queue = '11' AND main.Status = 'stalled' AND
 (
(  (  ( ObjectCustomFieldValues_1.Content = 'value1' )  )  )
OR  (  (  ( ObjectCustomFieldValues_2.Content = 'value2' )  )  )

 )
)
AND (main.Type = 'ticket')
AND (main.EffectiveId = main.id)
ORDER BY main.id ASC

I ran the queries through explain analyze and tried disabling nested
loops, then disabling hash joins (I tried disabling whatever the planner
was trying to use hoping it will try something else that is faster) but
the query speed did not change considerably.

Our database is not that big and can easily fit in the memory of the
machine (400MB filesize), and we have less than 6000 tickets total. The
queries I tried out return only a total of 4 to 5 tickets in the end. The
custom field that I am referring to above is a mandatory field so it is
assigned for almost all tickets, and with multiple values most of the
time.

Any advice?

-- 
\Georgi Georgiev   \  Ever notice that even the busiest people   \
/ Sysadmin Head/  are never too busy to tell you just how/
\-SBI Japannext-   \  busy they are? \


[rt-users] RT Queue mails with errors on Postfix

2011-01-05 Thread Gregory Greafers
Hi RT Community,
I have an issue I want to troubleshoot and resolve. I have 
- CentOS 5.5, 
- RT 3.8.8,
- postfix as an MTA running on [myrtdomain.com] sending and responding
to mails internal to [mycompanydomain.com]. mycompanydomain.com is on
MDaemon mail server
- apache2 server

I keep seeing this error in my postfix logs (tail -f /var/log/maillog)

Jan  5 14:08:10 noc postfix/cleanup[6000]: warning:
database /etc/postfix/virtual.db is older than source
file /etc/postfix/virtual
...
Jan  5 14:51:14 noc postfix/local[6094]: C11C85F696D:
to=n...@myrtdomain.com, relay=local, delay=11811,
delays=11811/0.01/0/0.2, dsn=4.3.0, status=deferred (temporary failure.
Command output: RT server error.  The RT server which handled your email
did not behave as expected. It said:  temporary failure - RT couldn't
find the queue: CoreNetwork )

My /etc/aliases has the queue specified, matching the CoreNetwork queue
I created on RT webinterface with my root account:

core:   |/opt/rt3/bin/rt-mailgate --queue CoreNetwork --action
correspond --url http://myrtdomain.com;
core-response:   |/opt/rt3/bin/rt-mailgate --queue CoreNetwork --action
comment --url http://myrtdomain.com;

Any ideas on how I can resolve this? I have tried these steps in
sequence
newaliases
postfix reload 
service postfix restart [ok]
service httpd restart   [ok]


-- 
Regards,

Gregory Okoth
NOC Engineer

Email:n...@accesskenya.com 
Tel:  (254 20) 360 0908
Fax: (254 20)(254 20) 360 0001






[rt-users] Not the spell fckeditor when creating a ticket

2011-01-05 Thread jose.fernan...@naxos-fr.net
Hello,

when creating a ticket, the spell checker button is disabled fckeditor.
How to enable this button?

Thank you



[rt-users] Show different queues in report.

2011-01-05 Thread Andreas.J

Hello,

I've been searching for a solution to this problem for some time now. I'm
hoping someone can help me.

I currently have about 25 different queues in my RT 3.8.8. I'm looking to
get statistic over a specific period of time. And mainly when tickets are
created. I can get hourly stats for a specific queue by the report module.
But I want to get a summary of all queues so I can compare these. If I
select chart by CreatedHourly now I get all queues collected in one graph.

So, is there a way to make it show the different queues and still get hourly
stats?

Regards Andreas Jacobsson
-- 
View this message in context: 
http://old.nabble.com/Show-different-queues-in-report.-tp30578565p30578565.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



Re: [rt-users] Backing up RT

2011-01-05 Thread Andy Graybeal

On 01/05/2011 09:07 AM, Max McGrath wrote:

I forgot to mention, I also backup a few other files/folder critical to RT:

##
#   BACKUP DATABASES #
##
mysqldump -u root rt3  rt3_backup.sql
mysqldump -u root mysql  mysql_backup.sql
#mysqldump -u root information_schema  information_schema_backup.sql

##
#  COPY OTHER FILES/FOLDERS  #
##
cp /etc/aliases /opt/rt3/lib/RT/rt-backup/
cp /etc/apache2/httpd.conf /opt/rt3/lib/RT/rt-backup/
cp /opt/rt3/etc/RT_SiteConfig.pm /opt/rt3/lib/RT/rt-backup/
cp -r /opt/rt3/local/ /opt/rt3/lib/RT/rt-backup/

This way I have a copy of my e-mail addresses for my queues, my apache
config, my SiteConfig, and my whole local folder
--
Max McGrath
Asst. Network Admin/Systems Specialist
Carthage College
262-552-5512
mmcgr...@carthage.edu mailto:mmcgr...@carthage.edu



Max, thank you for the list.  I will follow your footsteps.

-Andy


Re: [rt-users] Backing up RT

2011-01-05 Thread Andy Graybeal

On 01/05/2011 09:23 AM, Konstantin Khomoutov wrote:

On Wed, 05 Jan 2011 07:36:46 -0500
Andy Graybealandy.grayb...@casanueva.com  wrote:



If I ever ended up doing LVM snaps, do I need to lock the db first...
or can I get away with not locking the db with LVM snaps?

In this case locking is less important than flushing as you would be
backing up the filesystem and hence you will need the on-disk database
representation to be consistent before taking the snapshot. To do this,
you either have to stop the server just before taking a snapshot, or
write a complicated script which would work just like mysqlhotcopy but
would take the snapshot instead of copying the data.
Note that mysqlhotcopy explicitly states it works only with MyISAM and
ARCHIVE engines, and the comments on [1] hint that backing up InnoDB
this way is at least tricky and error-prone.


Argh.. Thank you for the knowledge. This is too much for my plate at the 
moment.  I'll put off the LVM snaps until needed and stick with config / 
db backups for now. Thanks again.





You use logrotate to manage your mysqldumps!  Excellent idea.
I need to learn logrotate.  I was wondering how I can keep mysqldumps
from each day and not lose control of them.  I'm excited.

One commonly used straightforward approach is to encode the formatted
timestamp into the names of generated backup files, like this:
$ mysqldump ... | gzip -c/path/to/db-backup-$(date +'%F-%T').sql.gz


Wonderful, I will make use of this technique.  I have seen and used this 
technique just last week. Though the addition of gzip is a spin on what 
I saw.  I like it.  Here's what I used: `date +%Y%m%d%H%M%S`.xml out of 
the PF book or website.




1. http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html



Again, thanks for the response.  Very helpful.

-Andy


Re: [rt-users] RT Queue mails with errors on Postfix

2011-01-05 Thread Joe Harris
The command newaliases I was led to believe was only for sendmail. What you 
need is:
postalias /etc/aliases

Unless you have newaliases somehow linked to the above, postfix won't read the 
aliases file. 

At least I hope that is it. :)


Sent from blackberry

-Original Message-
From: Gregory Greafers greg...@accesskenya.com
Sender: rt-users-boun...@lists.bestpractical.com
Date: Wed, 05 Jan 2011 15:34:21 
To: rt usersrt-users@lists.bestpractical.com
Reply-To: greg...@accesskenya.com
Subject: [rt-users]   RT Queue mails with errors on Postfix

Hi RT Community,
I have an issue I want to troubleshoot and resolve. I have 
- CentOS 5.5, 
- RT 3.8.8,
- postfix as an MTA running on [myrtdomain.com] sending and responding
to mails internal to [mycompanydomain.com]. mycompanydomain.com is on
MDaemon mail server
- apache2 server

I keep seeing this error in my postfix logs (tail -f /var/log/maillog)

Jan  5 14:08:10 noc postfix/cleanup[6000]: warning:
database /etc/postfix/virtual.db is older than source
file /etc/postfix/virtual
...
Jan  5 14:51:14 noc postfix/local[6094]: C11C85F696D:
to=n...@myrtdomain.com, relay=local, delay=11811,
delays=11811/0.01/0/0.2, dsn=4.3.0, status=deferred (temporary failure.
Command output: RT server error.  The RT server which handled your email
did not behave as expected. It said:  temporary failure - RT couldn't
find the queue: CoreNetwork )

My /etc/aliases has the queue specified, matching the CoreNetwork queue
I created on RT webinterface with my root account:

core:   |/opt/rt3/bin/rt-mailgate --queue CoreNetwork --action
correspond --url http://myrtdomain.com;
core-response:   |/opt/rt3/bin/rt-mailgate --queue CoreNetwork --action
comment --url http://myrtdomain.com;

Any ideas on how I can resolve this? I have tried these steps in
sequence
newaliases
postfix reload 
service postfix restart [ok]
service httpd restart   [ok]


-- 
Regards,

Gregory Okoth
NOC Engineer

Email:n...@accesskenya.com 
Tel:  (254 20) 360 0908
Fax: (254 20)(254 20) 360 0001







Re: [rt-users] Backing up RT

2011-01-05 Thread Emmanuel Lacour
On Wed, Jan 05, 2011 at 07:36:46AM -0500, Andy Graybeal wrote:
 You use logrotate to manage your mysqldumps!  Excellent idea.


if you are using Debian, the command savelog is also often convenient
to rotate a file at the beginning or end of a script.

saveloq -q /var/backups/mysql/dump.sql.gz
mysqldump ... | gzip -c  /var/backups/mysql/dump.sql.gz



Re: [rt-users] RT Queue mails with errors on Postfix

2011-01-05 Thread Emmanuel Lacour
On Wed, Jan 05, 2011 at 03:34:21PM +0300, Gregory Greafers wrote:
 
Jan  5 14:08:10 noc postfix/cleanup[6000]: warning: database
/etc/postfix/virtual.db is older than source file /etc/postfix/virtual
...

you should probably run postmap /etc/postfix/virtual

Jan  5 14:51:14 noc postfix/local[6094]: C11C85F696D:
to=n...@myrtdomain.com, relay=local, delay=11811,
delays=11811/0.01/0/0.2, dsn=4.3.0, status=deferred (temporary failure.
Command output: RT server error.  The RT server which handled your email
did not behave as expected. It said:  temporary failure - RT couldn't find
the queue: CoreNetwork )
 

if rt-mailgate tell you that he could not find a queue named
CoreNetwork, that's certainly true. Maybe there is some typo in the
queue name or maybe you're not working on the same RT?



Re: [rt-users] Browser (Firefox) does not save username and passwords

2011-01-05 Thread Emmanuel Lacour
On Wed, Jan 05, 2011 at 02:17:49PM +0100, Obando, David DE - EV wrote:
I already change the code (Elements/Login) and removed the
autocomplete=off parameter, but browser behaviour does not change.
 
Any ideas?
 

did you cleaned-up the mason cache?

rm -rf ./rt/var/mason_data/obj
then restart your web server.



Re: [rt-users] Backing up RT

2011-01-05 Thread Konstantin Khomoutov
On Wed, 05 Jan 2011 07:45:33 -0500
Andy Graybeal andy.grayb...@casanueva.com wrote:

 This is exactly what I do.  Is this a decent way to be doing it --
 I've always just assumed it was okay.  I do it hourly, and then SCP
 it to another system.
[...]
 What made you do hourly dumps?   I'm thinking now instead of nightly,
 I should be doing hourly dumps like you.

It's just about the amount of stuff you're OK to lose in case of a
problem requiring restoring the DB state from backups: if you have a
very busy RT instance where several ticket transactions per hour is
normal, you would want to do per-hour backups. If you have an RT
instance which only receives few tickets per week (as we do), even
weekly backups would do just fine.
So it's not about one backup schedule being more correct than the other.


[rt-users] Adding recently resolved to MyDay.html

2011-01-05 Thread Josh Narins
I might work on a ticket through the morning for a few hours, resolve it at 
noon, and only use the Tools-MyDay screen at the end of the day.

What I thought I might be able to do was add a second query, so the main loop 
looks like this:

% while ( my $Ticket = $Tickets-Next() || $Tickets2-Next()) {

And the second query, inserted right after the first, looks like this:

require Date::Manip;
my $Tickets2 = RT::Tickets-new($session{'CurrentUser'});
$Tickets2-LimitOwner(VALUE = $session{'CurrentUser'}-Id);
$Tickets2-LimitStatus( VALUE = 'resolved' );
$Tickets2-LimitResolved( OPERATOR = '', VALUE = 
Date::Manip::UnixDate(Date::Manip::ParseDate('yesterday'),'%Y-%m-%d'));
$Tickets2-OrderBy ( FIELD = 'Priority', ORDER = 'DESC');

I'm getting all the tickets from the first query in the list with the second. 
In fact, it looks like many of the tickets are being printed a total of three 
times.





Josh Narins

Director of Application Development
SeniorBridge
845 Third Ave
7th Floor
New York, NY 10022
Tel: (212) 994-6194
Fax: (212) 994-4260
Mobile: (917) 488-6248
jnar...@seniorbridge.com
seniorbridge.comhttp://www.seniorbridge.com/

[http://www.seniorbridge.com/images/seniorbridgedisclaimerTAG.gif]



SeniorBridge Statement of Confidentiality: The contents of this email message 
are intended for the exclusive use of the addressee(s) and may contain 
confidential or privileged information. Any dissemination, distribution or 
copying of this email by an unintended or mistaken recipient is strictly 
prohibited. In said event, kindly reply to the sender and destroy all entries 
of this message and any attachments from your system. Thank you.


Re: [rt-users] Custom field queries are very slow after 3.8.8 upgrade (from 3.6.10)

2011-01-05 Thread Kenneth Marshall
On Wed, Jan 05, 2011 at 07:31:37PM +0900, Georgi Georgiev wrote:
 I am looking for some advice on how to speed up some queries using
 custom fields that got unusably slow after an upgrade from the RT 3.6 series
 to 3.8.
 
 We are currently running RT 3.6.10 on CentOS 5.5 with a postgresql
 back end (used to be PgSQL 8.1 but we upgraded to 8.4 when CentOS 5.5
 came out). The RT package is from EPEL and everything is fine.
 
 When trying to upgrade to RT 3.8.8 some of our saved queries using
 custom fields get very, *very* slow. I tried this twelve months ago with
 RT 3.8.7 on CentOS 5.x and PgSQL 8.1 (whatever was current then), and
 also again today, on RHEL6 with PgSQL 8.4.
 
 The problematic queries look something like this:
 
 Queue = 'somequeue' AND Status = 'stalled' AND (
 'CF.{MyCF}' = 'value1' OR
 'CF.{MyCF}' = 'value2' OR
 'CF.{MyCF}' = 'value3' OR
 'CF.{MyCF}' = 'value4' OR
 'CF.{MyCF}' = 'value5' OR
 'CF.{MyCF}' = 'value6' OR
 'CF.{MyCF}' = 'value7' )
 
 where the listed values are 3-4 characters long and their number varies.
 
 After the ugprade, and with logging of slow queries enabled, I saw these
 numbers for queries with 5, 6, 7, and 8 OR statements for the custom
 field in the postgresql logs:
 - query for 5 possible CF values - 0.6 seconds
 - query for 6 possible CF values - 6 seconds
 - query for 7 possible CF values - 65 seconds
 - query for 8 possible CF values - 681 seconds
 
 In comparison, the corresponding query in RT 3.6 executes in less than 2
 milliseconds.
 
 One thing I noticed is that the SQL that is generated by RT 3.6 and 3.8
 is substantially different.
 
 In 3.6 there is a single SELECT on the ObjectCustomFieldValues table, so
 the generated SQL looks like this:
 
 SELECT DISTINCT main.*
 FROM Tickets main
 JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
 ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
 AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
 AND ( ObjectCustomFieldValues_1.Disabled = '0' )
 AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
 WHERE (main.Status != 'deleted')
 AND (main.Queue = '11' AND main.Status = 'stalled' AND
 (
  ( ( ObjectCustomFieldValues_1.Content = 'value1' )  )
  OR  ( ( ObjectCustomFieldValues_1.Content = 'value2' )  )
 ...
 )
 )
 AND (main.Type = 'ticket')
 AND (main.EffectiveId = main.id)
 ORDER BY main.id ASC
 
 In RT 3.8.8 the generated SQL looks like this:
 
 SELECT DISTINCT main.*
 FROM Tickets main
 LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
 ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
 AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
 AND ( ObjectCustomFieldValues_1.Disabled =  '0' )
 AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
 LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_2
 ON  ( ObjectCustomFieldValues_2.CustomField = '1' )
 AND ( ObjectCustomFieldValues_2.ObjectType = 'RT::Ticket' )
 AND ( ObjectCustomFieldValues_2.Disabled =  '0' )
 AND ( ObjectCustomFieldValues_2.ObjectId = main.id )
 
 WHERE (main.Status != 'deleted')
 AND (
 main.Queue = '11' AND main.Status = 'stalled' AND
  (
 (  (  ( ObjectCustomFieldValues_1.Content = 'value1' )  )  )
 OR  (  (  ( ObjectCustomFieldValues_2.Content = 'value2' )  )  )
 
  )
 )
 AND (main.Type = 'ticket')
 AND (main.EffectiveId = main.id)
 ORDER BY main.id ASC
 
 I ran the queries through explain analyze and tried disabling nested
 loops, then disabling hash joins (I tried disabling whatever the planner
 was trying to use hoping it will try something else that is faster) but
 the query speed did not change considerably.
 
 Our database is not that big and can easily fit in the memory of the
 machine (400MB filesize), and we have less than 6000 tickets total. The
 queries I tried out return only a total of 4 to 5 tickets in the end. The
 custom field that I am referring to above is a mandatory field so it is
 assigned for almost all tickets, and with multiple values most of the
 time.
 
 Any advice?
 

Hi Georgi,

What are your postgresql.conf parameters? What are the EXPLAIN ANALYZE
results for the fast query (3.6.x) and the slow (3.8.8) query? That
should also point out where an index may help.

Cheers,
Ken


Re: [rt-users] Backing up RT

2011-01-05 Thread Max McGrath
I just figured in the case of a crash or any data loss, it'd be nice to have
only lost an hour or less worth of tickets!
--
Max McGrath
Asst. Network Admin/Systems Specialist
Carthage College
262-552-5512
mmcgr...@carthage.edu


On Wed, Jan 5, 2011 at 6:45 AM, Andy Graybeal
andy.grayb...@casanueva.comwrote:

  This is exactly what I do.  Is this a decent way to be doing it -- I've
 always just assumed it was okay.  I do it hourly, and then SCP it to
 another system.

 Should I be stopping mysql or anything  before doing the mysqldump?
 --


 Max,
 What made you do hourly dumps?   I'm thinking now instead of nightly, I
 should be doing hourly dumps like you.

 -Andy



Re: [rt-users] Backing up RT

2011-01-05 Thread Max McGrath
I forgot to mention, I also backup a few other files/folder critical to RT:

##
#   BACKUP DATABASES #
##
mysqldump -u root rt3  rt3_backup.sql
mysqldump -u root mysql  mysql_backup.sql
#mysqldump -u root information_schema  information_schema_backup.sql

##
#  COPY OTHER FILES/FOLDERS  #
##
cp /etc/aliases /opt/rt3/lib/RT/rt-backup/
cp /etc/apache2/httpd.conf /opt/rt3/lib/RT/rt-backup/
cp /opt/rt3/etc/RT_SiteConfig.pm /opt/rt3/lib/RT/rt-backup/
cp -r /opt/rt3/local/ /opt/rt3/lib/RT/rt-backup/

This way I have a copy of my e-mail addresses for my queues, my apache
config, my SiteConfig, and my whole local folder
--
Max McGrath
Asst. Network Admin/Systems Specialist
Carthage College
262-552-5512
mmcgr...@carthage.edu


On Wed, Jan 5, 2011 at 6:45 AM, Andy Graybeal
andy.grayb...@casanueva.comwrote:

  This is exactly what I do.  Is this a decent way to be doing it -- I've
 always just assumed it was okay.  I do it hourly, and then SCP it to
 another system.

 Should I be stopping mysql or anything  before doing the mysqldump?
 --


 Max,
 What made you do hourly dumps?   I'm thinking now instead of nightly, I
 should be doing hourly dumps like you.

 -Andy



Re: [rt-users] Copy Multiple value CF to the child ticket

2011-01-05 Thread Ahmed, Mohammed Naweed (LNG-BCT)
I am using version 3.8.4 so CustomFieldValuesAsString is not available.

I changed the template like this:
CustomField-n: {
 my $separator = \n;
 my $CFValue = $Tickets{'TOP'}-CustomFieldValues(n);
 return join ($separator, grep { defined $_ }
  map { $_-Content }
@{$CFValue-ItemsArrayRef});
   }

To get the values as strings but it still not working, Am I doing
something wrong or is there any extension available for
'CustomFieldValuesAsString' method?


Thanks
N Ahmed



-Original Message-
From: rt-users-boun...@lists.bestpractical.com
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Kevin
Falcone
Sent: Tuesday, January 04, 2011 5:03 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Copy Multiple value CF to the child ticket

On Tue, Jan 04, 2011 at 03:19:45PM -0500, Ahmed, Mohammed Naweed
(LNG-BCT) wrote:
I am creating a child ticket with some of the custom fields
populated from the parent ticket.
I know that we can copy the values of the parent CF to the child CF
by:
 
 
 
 CustomField-n: {$Tickets{'TOP'}-FirstCustomFieldValue('CF Name')}
 
 
 
But, how to copy multiple-value CF to the child ticket? The above
code is just populating the
first selected value.

Given a new enough RT, CustomFieldValuesAsString will work

-kevin

-
The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.


Re: [rt-users] Browser (Firefox) does not save username and passwords

2011-01-05 Thread Paul D. O'Rorke
I would have expected that to work, it's what I did and FF now remembers 
passwords. I actually commented out the original code and entered it ahain but 
it's the same as what you said you did. Looks like this: 

div class=input-row 
span class=label|/lPassword/:/span 
!-- span class=inputinput type=password name=pass autocomplete=off 
//span -- 
span class=inputinput type=password name=pass //span 
/div 

The only other thing that comes to mind is that my instance of RT has been 
restarted since making the change. I'm afraid I don't remember if that was 
relevant however... 

hth 

-- 
Paul O'Rorke 

p...@paulororke.net 
Home .: +1 (250) 483 1456 
Mobile.: +1 (250) 709 7740 


Re: [rt-users] RT Queue mails with errors on Postfix

2011-01-05 Thread Emmanuel Lacour
On Wed, Jan 05, 2011 at 03:43:49PM +, Joe Harris wrote:
The command newaliases I was led to believe was only for sendmail. What
you need is:


that's off topic for this list, but no, newaliases exists and works also
with postfix if you set variable alias_database correctly in your
postfix main.cf. For example:

# Where postfix local find aliases
alias_maps = hash:/etc/aliases
# What format:files should be updated when running newaliases
alias_database = hash:/etc/aliases



Re: [rt-users] RTx::Calendar Not Displaying

2011-01-05 Thread Lee Hughes
MyCalendar is included in $HomepageComponents (below) but nothing  
related to Calendar appears on the homepage. In fact, if I comment out  
the $HomepageComponents line completely and restart the web server,  
the homepage still looks the same, even if I clear my browser cache.  
How could that be?


I have the ExternalAuth plugin configured in the same RT_SiteConfig.pm  
file (below) and it is working fine.


Search on Calendar and calendar shows no results.

Are there any screenshots of what the Calendar links/pages should look like?

Is it possible to insert debug statements somewhere to verify that the  
Calendar plugin is actually getting called?


Thanks very much for the help.

Lee


Date: Tue, 4 Jan 2011 17:18:23 -0500
From: Kevin Falcone falc...@bestpractical.com
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RTx::Calendar Not Displaying
Message-ID: 20110104221823.gv65...@jibsheet.com
Content-Type: text/plain; charset=us-ascii

On Tue, Jan 04, 2011 at 12:44:51PM -0800, Lee Hughes wrote:

I cleared the Mason cache but still don't see any Calendar links.
Where should I see links, and how would I go about enabling basic
tracing to see if the Calendar module is even being called?


You didn't say where you looked for the calendars.
Did you try editing your homepage to include the MyCalendar widget?
Did you do a search and look for the calendar link?

-kevin


I've installed and configured RTx::Calendar per the instructions and
restarted the web server but don't see any links to it anywhere. I have
syslogging set to debug but no errors are logged.

Here are the relevant settings from RT_SiteConfig.pm:

# Calendar Plugin
require '/usr/local/rt3/local/plugins/RTx-Calendar/lib/RTx/Calendar.pm';
Set($HomepageComponents, [qw(QuickCreate Quicksearch MyCalendar
MyAdminQueues MySupportQueues MyReminders RefreshHomepage)]);

# enable all plugins
Set(@Plugins,qw(
RT::Authen::ExternalAuth
RTx::Calendar
));

Any ideas what I'm missing?

Did you clear the Mason cache?

rm -rf /usr/local/rt3/var/mason_data/obj/*

See http://requesttracker.wikia.com/wiki/CleanMasonCache for details.



[rt-users] attachment and This transaction appears to have no content

2011-01-05 Thread Rana Tanveer
Hi Community.

I am using RT 3.8.7, my problem is when we send attachment it returns
following message to requesters of the tickets along with attachment.

This transaction appears to have no content

and normal communication is fine, this happens only  when any of the
requester or AdminCC of the queue send attachment, can someone please help
regarding this issue as i am clueless reading mailing lists.


*LAHORE LIONS*

Rana Tanveer


[rt-users] Disallow 'resolve' unless a CF is set?

2011-01-05 Thread Jeff Blaine

We need to reject 'resolve' actions unless a certain
custom field is set to a value.

Is there a known solution for this, or should I start
hacking?


Re: [rt-users] Not the spell fckeditor when creating a ticket

2011-01-05 Thread Payam Poursaied
Hello,

when creating a ticket, the spell checker button is disabled fckeditor.
How to enable this button?

Thank you

Have tried it with some browser rather than IE?

In share/html/NoAuth/RichText/FCKeditor/fckconfig.js check the following
line:
FCKConfig.SpellChecker  = 'ieSpell' ;   // 'ieSpell' |
'SpellerPages'

This option has been set to ieSpell by default and it caused this button
to be disabled in non IE browsers.

For more info you can take a look here:
http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Spell_
Checker



smime.p7s
Description: S/MIME cryptographic signature


[rt-users] Scrip modifies ticket, but downstream scrips don't see the updates

2011-01-05 Thread Sue D. Nymme

One of our queues receives job requests via e-mail.  I have a scrip in place
that automatically assigns the newly-created ticket to any of several users,
if the subject is in a certain, easily-parsed format.  This works fine.


For this scrip, the condition is On Create, the action is User Defined,
the template is Blank, and the stage is TransactionCreate.  You can view
it at  http://www.nopaste.nl/?paste=2004 http://www.nopaste.nl/?paste=2004 .


Like I said, it works fine, but downstream scrips do NOT seem to see the
update.  I modified the WatchCreate template to include a line that says
This ticket has been assigned to [so-and-so].  This does not work.  It
sees the original owner, not the owner that was set by the earlier scrip. 
Yet, after the ticket is created, I can go into the RT web interface and see
that the owner was set properly.  My WatchCreate template is as follows:

Subject: New ticket {$Ticket-gt;id}: {$Ticket-gt;Subject}


Greetings,
{my ($id, $subj, $own) = ($Ticket-gt;id, $Ticket-gt;Subject,
$Ticket-gt;Owner);
$RT::Logger-gt;debug(qq#EJR-WatchCreate (queue): ID=$id, owner=$own,
subj=$subj#);
quot;$id -- $ownquot;;}
This message has been automatically generated in response to the
creation of support ticket number {$Ticket-gt;id}, regarding:
quot;{$Ticket-gt;Subject()}quot;, 
a summary of which appears below.
{my $owner = $Ticket-gt;Owner;
($owner amp;amp; $owner ne 'Nobody' amp;amp; $owner !=
$RT::Nobody-gt;Id)?
quot;\nThis ticket has been assigned to $owner.quot;
  : quot;\nThis ticket has not been assigned to anyone.quot;
}

Please don't reply to this message.  This ticket has been
assigned an ID of [{$Ticket-gt;QueueObj-gt;SubjectTag || $rtname}
#{$Ticket-gt;id()}].

-
{$Transaction-gt;Content()}


When I look in the RT debug log, I can see that the assign-owner scrip runs
first, and is successful, and the notify-watchers scrip runs latermdash;but
the log-debug in the notify-watchers scrip does not write anything to the
log.  However, the quot;$id -- $ownquot; line does get inserted into the
e-mail, so I know my code is being executed.  Anyhow, the user id that this
code block inserts into the watcher e-mail is the original owner (id 6,
Nobody), not the owner that was set by the earlier scrip.


What step am I missing here?

-- 
View this message in context: 
http://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don%27t-see-the-updates-tp30599938p30599938.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


[rt-users] RT-Authen-ExternalAuth and AD...

2011-01-05 Thread Tollefsen, Lyle
Hi,

We're running RT 3.8.8 and using RT-Authen-ExternalAuth 0.08 to authenticate 
against Active Directory. Any new AD account I create can logon to RT, and have 
corresponding account created in RT, if it is in the necessary security group, 
but older accounts, mine included, pass the password test, but fail at the 
group membership test, and fail to logon. The RT account, however, does get 
created. The log entries look like this...

Jan  5 15:12:29 RT388 RT: AD_GROUP2 AUTH FAILED: my-name 
(/opt/rt3/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/LDAP.pm:127)
Jan  5 15:12:29 RT388 RT: FAILED LOGIN for my-name from 192.168.1.1 
(/opt/rt3/bin/../lib/RT/Interface/Web.pm:424)

As I said above, older accounts (3 years plus) which are members of the group 
being tested fail to fully authenticate, while new accounts which are members 
of the same group, authenticate properly. In fact, If I comment out the group 
test from RT_SiteConfig.pm, I can logon to RT with my old account.

I don't know if this is pertinent, but we upgraded to Exchange 2007 a few 
months back, and I wonder if the AD schema changes could be affecting things?

Lyle.



Re: [rt-users] Disallow 'resolve' unless a CF is set?

2011-01-05 Thread Jeff Stark
Because we only require the CF on resolve and at no other time I hacked the 
update page when status = resolved.

I have seen others put scrips in place that set the status back to open but 
this didn't work for us, as we didn't want the ticket to appear to be resolved 
(submitted), we wanted to remain on the same page with the typical feedback.

Would be really nice if there was a way to add logic like that to the CF.

Good luck, and let me know if you need additional info on how I did this.

Jeff Stark
Sr Saas Engineer
Moxie Software
(919)622-0418 
jst...@moxiesoft.com
Www.Moxiesoft.com
CONNECT PEOPLE. SHARE KNOWLEDGE. DELIVER RESULTS.


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jeff Blaine
Sent: Wednesday, January 05, 2011 2:03 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Disallow 'resolve' unless a CF is set?

We need to reject 'resolve' actions unless a certain custom field is set to a 
value.

Is there a known solution for this, or should I start hacking?



Re: [rt-users] Scrip modifies ticket, but downstream scrips don't see the updates

2011-01-05 Thread Kenneth Crocker
Sue,

Try changing the stage to TransactionBatch. Make sure your configuration
is set to use same. Then, you need to be sure the names of the scrips a such
that an alphabetical execution of them will execute the scrip that assigns
the owners first.

Kenn
LBNL

On Wed, Jan 5, 2011 at 12:46 PM, Sue D. Nymme sdn.old...@mailnull.comwrote:

 One of our queues receives job requests via e-mail. I have a scrip in place
 that automatically assigns the newly-created ticket to any of several users,
 if the subject is in a certain, easily-parsed format. This works fine.

 For this scrip, the condition is On Create, the action is User Defined,
 the template is Blank, and the stage is TransactionCreate. You can view
 it at http://www.nopaste.nl/?paste=2004.

 Like I said, it works fine, but downstream scrips do NOT seem to see the
 update. I modified the WatchCreate template to include a line that says
 This ticket has been assigned to [so-and-so]. This does not work. It sees
 the original owner, not the owner that was set by the earlier scrip. Yet,
 after the ticket is created, I can go into the RT web interface and see that
 the owner was set properly. My WatchCreate template is as follows:

 Subject: New ticket {$Ticket-id}: {$Ticket-Subject}


 Greetings,
 {my ($id, $subj, $own) = ($Ticket-id, $Ticket-Subject, $Ticket-Owner);
 $RT::Logger-debug(qq#EJR-WatchCreate (queue): ID=$id, owner=$own, 
 subj=$subj#);
 $id -- $own;}
 This message has been automatically generated in response to the
 creation of support ticket number {$Ticket-id}, regarding:
   {$Ticket-Subject()},
 a summary of which appears below.
 {my $owner = $Ticket-Owner;
 ($owner  $owner ne 'Nobody'  $owner != $RT::Nobody-Id)?
 \nThis ticket has been assigned to $owner.
   : \nThis ticket has not been assigned to anyone.
 }

 Please don't reply to this message.  This ticket has been
 assigned an ID of [{$Ticket-QueueObj-SubjectTag || $rtname} 
 #{$Ticket-id()}].

 -
 {$Transaction-Content()}

 When I look in the RT debug log, I can see that the assign-owner scrip runs
 first, and is successful, and the notify-watchers scrip runs later—but the
 log-debug in the notify-watchers scrip does not write anything to the log.
 However, the $id -- $own line *does* get inserted into the e-mail, so I
 know my code is being executed. Anyhow, the user id that this code block
 inserts into the watcher e-mail is the original owner (id 6, Nobody), not
 the owner that was set by the earlier scrip.

 What step am I missing here?

 --
 View this message in context: Scrip modifies ticket, but downstream scrips
 don't see the 
 updateshttp://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don%27t-see-the-updates-tp30599938p30599938.html
 Sent from the Request Tracker - User mailing list 
 archivehttp://old.nabble.com/Request-Tracker---User-f572.htmlat Nabble.com.



[rt-users] time worked - within a certain time period

2011-01-05 Thread tarminuscf

Hi All, 

If I have a ticket that is 1 month old. How can I get the value of time 
worked tallied up for only the last 7 days the ticket was worked on? 

So if the ticket has a grand total of 200 minutes on the 1 month old ticket. 
But the last 7 days only have a cumulative 60 minutes worked. The value 
I would be looking for is that 60 minutes. 

Anyone have insights on how I can get that value by means of RT reporting 
or direct DB query? 

thanks, 
tar
-- 
View this message in context: 
http://old.nabble.com/time-worked---within-a-certain-time-period-tp30600856p30600856.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



Re: [rt-users] time worked - within a certain time period

2011-01-05 Thread Ruslan Zakirov
Hi,

SELECT SUM(TimeWorked) FROM Transactions WHERE ObjectId = ticket id
AND ObjectType = 'RT::Ticket' AND Created BETWEEN start date AND
end date;

On Thu, Jan 6, 2011 at 1:45 AM, tarminuscf tarminu...@gmail.com wrote:

 Hi All,

 If I have a ticket that is 1 month old. How can I get the value of time
 worked tallied up for only the last 7 days the ticket was worked on?

 So if the ticket has a grand total of 200 minutes on the 1 month old ticket.
 But the last 7 days only have a cumulative 60 minutes worked. The value
 I would be looking for is that 60 minutes.

 Anyone have insights on how I can get that value by means of RT reporting
 or direct DB query?

 thanks,
 tar
 --
 View this message in context: 
 http://old.nabble.com/time-worked---within-a-certain-time-period-tp30600856p30600856.html
 Sent from the Request Tracker - User mailing list archive at Nabble.com.





-- 
Best regards, Ruslan.


Re: [rt-users] time worked - within a certain time period

2011-01-05 Thread Stuart Browne
Doesn't that miss if someone just changes the TimeWorked value on the Basic tab 
of the ticket?

I use (in MySQL SQL):

SUM(IF(Field = 'TimeWorked', NewValue - OldValue, TimeTaken)) as TimeWorked

 -Original Message-
 From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
 boun...@lists.bestpractical.com] On Behalf Of Ruslan Zakirov
 Sent: Thursday, 6 January 2011 11:13 AM
 To: tarminuscf
 Cc: rt-users@lists.bestpractical.com
 Subject: Re: [rt-users] time worked - within a certain time period
 
 Hi,
 
 SELECT SUM(TimeWorked) FROM Transactions WHERE ObjectId = ticket id
 AND ObjectType = 'RT::Ticket' AND Created BETWEEN start date AND
 end date;
 
 On Thu, Jan 6, 2011 at 1:45 AM, tarminuscf tarminu...@gmail.com wrote:
 
  Hi All,
 
  If I have a ticket that is 1 month old. How can I get the value of time
  worked tallied up for only the last 7 days the ticket was worked on?
 
  So if the ticket has a grand total of 200 minutes on the 1 month old
 ticket.
  But the last 7 days only have a cumulative 60 minutes worked. The value
  I would be looking for is that 60 minutes.
 
  Anyone have insights on how I can get that value by means of RT
 reporting
  or direct DB query?


Re: [rt-users] time worked - within a certain time period

2011-01-05 Thread Andy Lee
Thanks Ruslan/Stuart,

I haven't given your query a shot but I believe i've found a solution that
was already developed by Fran F. :

http://requesttracker.wikia.com/wiki/TimeWorkedReport

Thanks all!

Regards,
tar

On Wed, Jan 5, 2011 at 4:13 PM, Ruslan Zakirov r...@bestpractical.comwrote:

 Hi,

 SELECT SUM(TimeWorked) FROM Transactions WHERE ObjectId = ticket id
 AND ObjectType = 'RT::Ticket' AND Created BETWEEN start date AND
 end date;

 On Thu, Jan 6, 2011 at 1:45 AM, tarminuscf tarminu...@gmail.com wrote:
 
  Hi All,
 
  If I have a ticket that is 1 month old. How can I get the value of time
  worked tallied up for only the last 7 days the ticket was worked on?
 
  So if the ticket has a grand total of 200 minutes on the 1 month old
 ticket.
  But the last 7 days only have a cumulative 60 minutes worked. The value
  I would be looking for is that 60 minutes.
 
  Anyone have insights on how I can get that value by means of RT reporting
  or direct DB query?
 
  thanks,
  tar
  --
  View this message in context:
 http://old.nabble.com/time-worked---within-a-certain-time-period-tp30600856p30600856.html
  Sent from the Request Tracker - User mailing list archive at Nabble.com.
 
 



 --
 Best regards, Ruslan.



Re: [rt-users] Custom field queries are very slow after 3.8.8 upgrade (from 3.6.10)

2011-01-05 Thread Georgi Georgiev
Quoting Kenneth Marshall at 05/01/2011-08:14:10(-0600):
 On Wed, Jan 05, 2011 at 07:31:37PM +0900, Georgi Georgiev wrote:
  I am looking for some advice on how to speed up some queries using
  custom fields that got unusably slow after an upgrade from the RT 3.6 series
  to 3.8.
  
  We are currently running RT 3.6.10 on CentOS 5.5 with a postgresql
  back end (used to be PgSQL 8.1 but we upgraded to 8.4 when CentOS 5.5
  came out). The RT package is from EPEL and everything is fine.
  
  When trying to upgrade to RT 3.8.8 some of our saved queries using
  custom fields get very, *very* slow. I tried this twelve months ago with
  RT 3.8.7 on CentOS 5.x and PgSQL 8.1 (whatever was current then), and
  also again today, on RHEL6 with PgSQL 8.4.
  
  The problematic queries look something like this:
  
  Queue = 'somequeue' AND Status = 'stalled' AND (
  'CF.{MyCF}' = 'value1' OR
  'CF.{MyCF}' = 'value2' OR
  'CF.{MyCF}' = 'value3' OR
  'CF.{MyCF}' = 'value4' OR
  'CF.{MyCF}' = 'value5' OR
  'CF.{MyCF}' = 'value6' OR
  'CF.{MyCF}' = 'value7' )
  
  where the listed values are 3-4 characters long and their number varies.
  
  After the ugprade, and with logging of slow queries enabled, I saw these
  numbers for queries with 5, 6, 7, and 8 OR statements for the custom
  field in the postgresql logs:
  - query for 5 possible CF values - 0.6 seconds
  - query for 6 possible CF values - 6 seconds
  - query for 7 possible CF values - 65 seconds
  - query for 8 possible CF values - 681 seconds
  
  In comparison, the corresponding query in RT 3.6 executes in less than 2
  milliseconds.
  
  One thing I noticed is that the SQL that is generated by RT 3.6 and 3.8
  is substantially different.
  
  In 3.6 there is a single SELECT on the ObjectCustomFieldValues table, so
  the generated SQL looks like this:
  
  SELECT DISTINCT main.*
  FROM Tickets main
  JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
  ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
  AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
  AND ( ObjectCustomFieldValues_1.Disabled = '0' )
  AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
  WHERE (main.Status != 'deleted')
  AND (main.Queue = '11' AND main.Status = 'stalled' AND
  (
   ( ( ObjectCustomFieldValues_1.Content = 'value1' )  )
   OR  ( ( ObjectCustomFieldValues_1.Content = 'value2' )  )
  ...
  )
  )
  AND (main.Type = 'ticket')
  AND (main.EffectiveId = main.id)
  ORDER BY main.id ASC
  
  In RT 3.8.8 the generated SQL looks like this:
  
  SELECT DISTINCT main.*
  FROM Tickets main
  LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1
  ON  ( ObjectCustomFieldValues_1.CustomField = '1' )
  AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' )
  AND ( ObjectCustomFieldValues_1.Disabled =  '0' )
  AND ( ObjectCustomFieldValues_1.ObjectId = main.id )
  LEFT JOIN ObjectCustomFieldValues ObjectCustomFieldValues_2
  ON  ( ObjectCustomFieldValues_2.CustomField = '1' )
  AND ( ObjectCustomFieldValues_2.ObjectType = 'RT::Ticket' )
  AND ( ObjectCustomFieldValues_2.Disabled =  '0' )
  AND ( ObjectCustomFieldValues_2.ObjectId = main.id )
  
  WHERE (main.Status != 'deleted')
  AND (
  main.Queue = '11' AND main.Status = 'stalled' AND
   (
  (  (  ( ObjectCustomFieldValues_1.Content = 'value1' )  )  )
  OR  (  (  ( ObjectCustomFieldValues_2.Content = 'value2' )  )  )
  
   )
  )
  AND (main.Type = 'ticket')
  AND (main.EffectiveId = main.id)
  ORDER BY main.id ASC
  
  I ran the queries through explain analyze and tried disabling nested
  loops, then disabling hash joins (I tried disabling whatever the planner
  was trying to use hoping it will try something else that is faster) but
  the query speed did not change considerably.
  
  Our database is not that big and can easily fit in the memory of the
  machine (400MB filesize), and we have less than 6000 tickets total. The
  queries I tried out return only a total of 4 to 5 tickets in the end. The
  custom field that I am referring to above is a mandatory field so it is
  assigned for almost all tickets, and with multiple values most of the
  time.
  
  Any advice?
  
 
 Hi Georgi,
 
 What are your postgresql.conf parameters?
 
 What are the EXPLAIN ANALYZE results for the fast query (3.6.x) and
 the slow (3.8.8) query? That should also point out where an index may
 help.

Thanks for the pointers, Kenneth.

We actually haven't touched postgresql.conf at all. The defaults have
worked fine for our small postgresql installation thus far and I just
didn't know where I should look next - in RT or postgres. Here is our
postgresql.conf (it's the default one on the distro) and it is identical
on RHEL6 and CentOS 5.5.

max_connections = 100
shared_buffers = 32MB
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 0
datestyle = 'iso, mdy'
lc_messages = 'en_US.UTF-8'
lc_monetary = 'en_US.UTF-8'
lc_numeric =