Hi,
I've a doubt regarding a select.
There are 2 tables: ITEMS and SUPPLIERS.
Each item can be related to a supplier.
TABLE ITEMS
-----------
ITEM_PK INT
SUPPL_FK C(4)
etc...
TABLE SUPPLIERS
-----------
SUPPL_PK C(4)
SUPPL_NME C(40)
etc...
I need to collect all suppliers present in the ITEMS table.
Note that the SUPPLIERS table could contain 1000 records and only 100 of them could be present in the ITEMS table.
The select command I use to gather suppliers name is:
select ;
SUPPLIERS.SUPPL_NME ;
from ITEMS ;
join SUPPLIERS on ITEMS.SUPPL_FK == SUPPLIERS.SUPPL_PK ;
where NOT SUPPL_FK == ""
order by SUPPLIERS.SUPPL_NME ;
group by SUPPLIERS.SUPPL_NME
There's an index on SUPPL_FK.
The ITEMS table is 20 MB large and the SUPPLIERS table is quite small (300 KB).
The select transfers about 20 MB, while I was expecting to see a small amount of data passing through the network. :(
sys(3054) says that rushmore is using the tag "SUPPL_FK" to optimize the table
I'm surely missing something obvious.. any help? :)