Search code examples
sybasesap-iq

What is Sybase IQ's query plan?


The main problem is this line

SET TEMPORARY OPTION QUERY_PLAN_AS_HTML_DIRECTORY = ‘#WHAT SHOULD I TYPE HERE?, THERE ARE ONLY DATABASES ON MY LEFT HAND SIDE’;

I don't understand the concept of directories in database.

I've read what the option QUERY_PLAN_AS_HTML_DIRECTORY does which explains the option. And I came to know about query plan from this pdf while looking for sources to optimize query.


Solution

  • Pages 13 & 14 in the document you linked explain that this should be a directory on the system that Sybase IQ is installed on, and it should probably be in the path of the Sybase IQ installation to ensure that the database can write to it.

    From the PDF:

    Note: Set the Query_Plan_As_HTML_Directory variable to an existing directory, or the HTML file will show up in the closest existing directory.

    In the example, they used '/opt/sybase/TPCHDB/QueryPlans' likely because IQ is installed in /opt/sybase

    So the command for setting it permanently is:

    set option public.Query_Plan_As_HTML_Directory = '/opt/sybase/TPCHDB/QueryPlans';
    

    I assume set temporary is a per session setting, so the syntax would be:

    set temporary option public.Query_Plan_As_HTML_Directory = '/opt/sybase/TPCHDB/QueryPlans';