Subject | Re: [ib-support] Speed problem |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-09-04T10:06:35Z |
>The previous single query took 65 seconds, this one took 70OK, I'm beaten. I think this last PLAN seems very good, but evidently it's
>seconds to the same point. ( Opening the queries in IB_SQL
>takes the same sort of time )
not good enough.
>Where should I be asking for an explination into the differences?This is the perfect place to discuss speed issues I think, just hope for
someone else to pick up the thread. Or maybe someone else can suggest
another place?
Set
...OK, almost beaten. Try the following as well - just to be sure (I would
be very surprised if this helped much):
SELECT T.ROOM
, COUNT (*) AS COUNTS
, MAX( T.PREVIOUS ) AS MAXTIME
, SUM( T.PREVIOUS ) AS SUMTIME
, ( SELECT COUNT (*) FROM TRANSACTIONS C1
JOIN ROOMSTAT R1 ON R1.TERMINAL = C1.ROOM
WHERE C1.TICKET_REF BETWEEN :FROMD AND :TOD
AND C1.APPLET = T.APPLET
AND C1.PREVIOUS < R1.X5
AND C1.ROOM = T.ROOM ) AS CNT1
, ( SELECT COUNT (*) FROM TRANSACTIONS C2
JOIN ROOMSTAT R2 ON R2.TERMINAL = C2.ROOM
WHERE C2.TICKET_REF BETWEEN :FROMD AND :TOD
AND C2.APPLET = T.APPLET
AND C2.PREVIOUS >= R2.X5
AND C2.PREVIOUS < R2.X6
AND C2.ROOM = T.ROOM ) AS CNT2
, ( SELECT COUNT (*) FROM TRANSACTIONS C3
JOIN ROOMSTAT R3 ON R3.TERMINAL = C3.ROOM
WHERE C3.TICKET_REF BETWEEN :FROMD AND :TOD
AND C3.APPLET = T.APPLET
AND C3.PREVIOUS >= R3.X6
AND C3.ROOM = T.ROOM ) AS CNT3
, T.APPLET
FROM TRANSACTIONS T
WHERE T.TICKET_REF BETWEEN :FROMD AND :TOD
GROUP BY T.APPLET, T.ROOM
ORDER BY T.APPLET DESC, T.ROOM