Subject | Re: [firebird-support] IS this the right thing to do (trigger) |
---|---|
Author | Robert martin |
Post date | 2008-11-20T21:50:44Z |
Hi Sean
Thansk for all yo0ur help so far :)
Leyne, Sean wrote:
SELECT bs.SendTable, COUNT(bs.SendTable) AS NumRecs
FROM BranchSend bs
WHERE bs.RegionRef = :RegionRef
AND bs.TransferConfirmed = 'F'
GROUP BY bs.SendTable
PLAN
PLAN (BS ORDER BRANCHSEND_SENDTABLE INDEX (BRANCHSEND_REGIONREF,
BranchSend_TransConf))
Thansk for all yo0ur help so far :)
Leyne, Sean wrote:
> Robert,= to the number of regions (branches) currently 15.
>
>
>>> What indexes are defined on the BranchSend table?
>>>
>> CREATE INDEX BranchSend_RegionRef ON BranchSend(RegionRef)^
>> CREATE INDEX BranchSend_SendTable ON BranchSend(SendTable)^
>> CREATE INDEX BranchSend_PkRef ON BranchSend(PkRef)^
>> CREATE INDEX BranchSend_TransConf ON BranchSend(TransferConfirmed)^
>> CREATE INDEX BranchSend_TransferBatchRef ON
>>
> BranchSend(TransferBatchRef)^
>
> How many unique RegionRef values are there?
>
>
> How many unique SendTable values are there?About 10
>
>
> What is the exact SQL and PLAN generated for the counts query?SQL
>
>
>
SELECT bs.SendTable, COUNT(bs.SendTable) AS NumRecs
FROM BranchSend bs
WHERE bs.RegionRef = :RegionRef
AND bs.TransferConfirmed = 'F'
GROUP BY bs.SendTable
PLAN
PLAN (BS ORDER BRANCHSEND_SENDTABLE INDEX (BRANCHSEND_REGIONREF,
BranchSend_TransConf))