Two queries are run on the customer_address table:
create or replace TABLE CUSTOMER_ADDRESS ( CA_ADDRESS_SK NUMBER(38,0), CA_ADDRESS_ID VARCHAR(16), CA_STREET_NUMBER VARCHAR(IO) CA_STREET_NAME VARCHAR(60), CA_STREET_TYPE VARCHAR(15), CA_SUITE_NUMBER VARCHAR(10), CA_CITY VARCHAR(60), CA_COUNTY
VARCHAR(30), CA_STATE VARCHAR(2), CA_ZIP VARCHAR(10), CA_COUNTRY VARCHAR(20), CA_GMT_OFFSET NUMBER(5,2), CA_LOCATION_TYPE
VARCHAR(20) );
ALTER TABLE DEMO_DB.DEMO_SCH.CUSTOMER_ADDRESS ADD SEARCH OPTIMIZATION ON SUBSTRING(CA_ADDRESS_ID);
Which queries will benefit from the use of the search optimization service? (Select TWO).
The use of the search optimization service in Snowflake is particularly effective when queries involve operations that match exact substrings or start from the beginning of a string. The ALTER TABLE command adding search optimization specifically for substrings on the CA_ADDRESS_ID field allows the service to create an optimized search path for queries using substring matches.
Option A benefits because it directly matches a substring from the start of the CA_ADDRESS_ID, aligning with the optimization's capability to quickly locate records based on the beginning segments of strings.
Option B also benefits, despite performing a full equality check, because it essentially compares the full length of CA_ADDRESS_ID to a substring, which can leverage the substring index for efficient retrieval. Options C, D, and E involve patterns that do not start from the beginning of the string or use negations, which are not optimized by the search optimization service configured for starting substring matches. Reference: Snowflake's documentation on the use of search optimization for substring matching in SQL queries.
Krystal
3 months agoRosina
3 months agoEdison
3 months agoKimbery
4 months agoStacey
4 months agoNatalie
4 months agoLigia
4 months agoGlenn
4 months agoCorinne
5 months agoErick
5 months agoSunshine
5 months agoDorothy
5 months agoShaniqua
5 months agoMarkus
5 months agoYasuko
12 months agoNu
12 months agoTwanna
12 months agoVeronika
11 months agoXuan
11 months agoCarole
11 months agoAimee
11 months agoKenneth
1 year agoFelicidad
1 year agoTrina
1 year agoEileen
1 year agoCarissa
1 year agoCarissa
1 year ago