ADSM-L

Re: [ADSM-L] issue with sql syntax in TSM database

2010-03-16 13:24:30
Subject: Re: [ADSM-L] issue with sql syntax in TSM database
From: Richard Sims <rbs AT BU DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 16 Mar 2010 13:23:06 -0400
On Mar 16, 2010, at 1:15 PM, yoda woya wrote:

> I am trying to run this sql and cannot get a result
> 
> select date(start_time),  sum(bytes)
> 
>        from
>        summary
>                where
>                ACTIVITY = 'BACKUP'
>                or ACTIVITY = 'RESTORE'
> 
>                group by date(start_time)
> 
> any reasons why??

Probably, performance.
Using OR is considerably less efficient than using IN;
so try "... where ACTIVITY in ('BACKUP','RESTORE') ..."

Further, if you never need Summary data older than a certain number of days, 
consider having your SUMmaryretention value close to that, to reduce bulk in 
the table.

    Richard Sims    http://people.bu.edu/rbs/