Subject Re: [firebird-support] 3rd Request for Help - How can optimize and speed up this query?
Author SoftTech
Greetings Douglas,

I got a reply from the developer of Database Workbench today so I can finally answer one of your questions:

Douglas: What is the selectivity of the indexes that appear in the plan?
Here is the info you requested for all tables involved. Please note that we have adopted the usage of IX_ for an added index, REF when it is a foreign key and PK_ when it is a primary key. Is this what you needed?

Thanks Douglas...

ACCT_TRAN_DETAIL (152)
Primary pointer page: 2230, Index root page: 2231
Data pages: 63546, data page slots: 63546, average fill: 86%
Fill distribution:
0 - 19% = 0
20 - 39% = 1
40 - 59% = 0
60 - 79% = 1430
80 - 99% = 62115

Index IX_ACCT_TRAN_DETAIL_TRAN_DATE (4)
Depth: 3, leaf buckets: 1905, nodes: 1283860
Average data length: 0.00, total dup: 1282471, max dup: 33104
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 1905

Index IX_ACCT_TRAN_DET_POS_IDX (1)
Depth: 3, leaf buckets: 1929, nodes: 1283873
Average data length: 0.00, total dup: 1281290, max dup: 69115
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 47
60 - 79% = 0
80 - 99% = 1882

Index PK_ACCT_TRAN_DETAIL_ID (0)
Depth: 3, leaf buckets: 2222, nodes: 1283872
Average data length: 1.00, total dup: 0, max dup: 0
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 2222

Index REFACCT_TRAN_MASTER777 (3)
Depth: 3, leaf buckets: 2172, nodes: 1283872
Average data length: 0.00, total dup: 206736, max dup: 21
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 2172

Index REFACTIVITY625 (2)
Depth: 3, leaf buckets: 1909, nodes: 1283872
Average data length: 0.00, total dup: 1283871, max dup: 1283871
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 3
60 - 79% = 0
80 - 99% = 1906


ACCT_TRAN_MASTER (172)
Primary pointer page: 2271, Index root page: 2272
Data pages: 30039, data page slots: 30039, average fill: 77%
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 30037
80 - 99% = 2

Index PK_ACCT_TRAN_MASTER (0)
Depth: 3, leaf buckets: 1865, nodes: 1077371
Average data length: 1.00, total dup: 0, max dup: 0
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 1
80 - 99% = 1864

Index REFCASE459 (2)
Depth: 3, leaf buckets: 1840, nodes: 1077371
Average data length: 0.00, total dup: 854177, max dup: 135
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 18
60 - 79% = 1
80 - 99% = 1821

Index REFCOMPANY455 (5)
Depth: 3, leaf buckets: 1602, nodes: 1077372
Average data length: 0.00, total dup: 1077368, max dup: 506484
Fill distribution:
0 - 19% = 0
20 - 39% = 1
40 - 59% = 6
60 - 79% = 0
80 - 99% = 1595

Index REFCOMPANY_DEPARTMENT581 (3)
Depth: 3, leaf buckets: 1602, nodes: 1077371
Average data length: 0.00, total dup: 1077369, max dup: 1077349
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 2
60 - 79% = 1
80 - 99% = 1599

Index REFTE_PLAN580 (4)
Depth: 3, leaf buckets: 1645, nodes: 1077371
Average data length: 0.00, total dup: 1077340, max dup: 255840
Fill distribution:
0 - 19% = 0
20 - 39% = 3
40 - 59% = 62
60 - 79% = 33
80 - 99% = 1547

Index REFTE_TRAN259 (1)
Depth: 3, leaf buckets: 1603, nodes: 1077371
Average data length: 0.00, total dup: 1077234, max dup: 109890
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 8
60 - 79% = 1
80 - 99% = 1594



ACCT_TRAN_QUE_STATUS (173)
Primary pointer page: 2273, Index root page: 2274
Data pages: 1, data page slots: 1, average fill: 9%
Fill distribution:
0 - 19% = 1
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0

Index PK_ACCT_TRAN_QUE_STATUS (0)
Depth: 1, leaf buckets: 1, nodes: 9
Average data length: 1.00, total dup: 0, max dup: 0
Fill distribution:
0 - 19% = 1
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0


TE_PLAN_TRAN (494)
Primary pointer page: 2924, Index root page: 2925
Data pages: 2, data page slots: 2, average fill: 66%
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 1
60 - 79% = 0
80 - 99% = 1

Index PK_TE_PLAN_TRAN (0)
Depth: 1, leaf buckets: 1, nodes: 41
Average data length: 5.00, total dup: 0, max dup: 0
Fill distribution:
0 - 19% = 1
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0

Index REFTE_PLAN154 (1)
Depth: 1, leaf buckets: 1, nodes: 41
Average data length: 0.00, total dup: 9, max dup: 2
Fill distribution:
0 - 19% = 1
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0


TE_TRAN (519)
Primary pointer page: 2974, Index root page: 2975
Data pages: 7, data page slots: 7, average fill: 75%
Fill distribution:
0 - 19% = 1
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 6

Index PK_TE_TRAN (0)
Depth: 1, leaf buckets: 1, nodes: 149
Average data length: 1.00, total dup: 0, max dup: 0
Fill distribution:
0 - 19% = 0
20 - 39% = 1
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0

Index REFCOMPANY577 (2)
Depth: 1, leaf buckets: 1, nodes: 149
Average data length: 0.00, total dup: 145, max dup: 60
Fill distribution:
0 - 19% = 0
20 - 39% = 1
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0

Index REFTE_TRAN_CLASS258 (1)
Depth: 1, leaf buckets: 1, nodes: 149
Average data length: 0.00, total dup: 143, max dup: 115
Fill distribution:
0 - 19% = 0
20 - 39% = 1
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0


[Non-text portions of this message have been removed]