Which three ALTER TABLE commands enable the optimizer to user an index for this WHERE patterns?

An application packs several fields of information into the details column of the table
sensors. The first six characters of that data represent a location code.
Example: “ABCDEFOO –ooozzz comments will be here FIELDS—-FIELD64”
Given the query pattern:
SELECT—-FROM sensors WHERE details LIKE ‘ABCDEF
Which three ALTER TABLE commands enable the optimizer to user an index for this
WHERE patterns?

An application packs several fields of information into the details column of the table
sensors. The first six characters of that data represent a location code.
Example: “ABCDEFOO –ooozzz comments will be here FIELDS—-FIELD64”
Given the query pattern:
SELECT—-FROM sensors WHERE details LIKE ‘ABCDEF
Which three ALTER TABLE commands enable the optimizer to user an index for this
WHERE patterns?

A.
ALTER TABLE sensors ADD KEY (details ) USING BTREE

B.
ALTER TABLE sensors ADD KEY (details) USING HASH

C.
ALTER TABLE sensors ADD KEY (details) USING BTREE

D.
ALTER TABLE sensors ADD KEY (details )USING HASH

E.
ALTER TABLE sensors ADD FULLTEX (details)



Leave a Reply 5

Your email address will not be published. Required fields are marked *


jhutch

jhutch

When using a like ‘ABCDEF’ Hash does nothing for you so it would be A,C,E

zz

zz

I guess A,C,E too

420

420

b-tree can be used for LIKE and hash can be used ONLY for comparison with () and for smoking ..
so aaaaaa,ccccccc,eeeeeee

420

420

comparison with

420

420

more than , and less than