Explain Plan for queries
Posted in 2003
Topics: Performance & Tuning, Server Administration
Hi,
I have a bunch of issues, though mostly related to obtaining the query
plan in informix. I am working with version 9.30.
I am a newbie to Informix online dynamic server. So my questions might
be too basic. Please be patient with me.
I need to obtain the query plan for a set of queries and tune them. I am
using DBACCESS to run the queries. Going through the documents I came to
know that I can get the query plan by executing SET EXPLAIN ON and then
executing my queries. Now I have the following questions
1. Is there a way in INFORMIX as in ORACLE to obtain the query plan,
without actually executing the queries? If yes how?
2. As I mentioned I need to obtain query plans for multiple
queries. Is there a way to run a whole file having all these
queries using DBACCESS?
3. All my queries are huge in size. So is there a mechanism to set the
SQL Edit buffer size in dbaccess, as I am getting a error "801: SQL
Edit buffer is full."
4. As in Oracle SQLPLUS (set spool on), is there a way to redirect the
output to a file in Informix.
Please clarify
--
Posted via http://dbforums.com
ovkrishna wrote:
> I have a bunch of issues, though mostly related to obtaining the query
> plan in informix. I am working with version 9.30.
>
> I am a newbie to Informix online dynamic server. So my questions might
> be too basic. Please be patient with me.
>
> I need to obtain the query plan for a set of queries and tune them. I am
> using DBACCESS to run the queries. Going through the documents I came to
> know that I can get the query plan by executing SET EXPLAIN ON and then
> executing my queries. Now I have the following questions
>
> 1. Is there a way in INFORMIX as in ORACLE to obtain the query plan,
> without actually executing the queries? If yes how?
Not in 9.30, I think there is an EXPLAIN optimiser directive in 9.40.
> 2. As I mentioned I need to obtain query plans for multiple
> queries. Is there a way to run a whole file having all these
> queries using DBACCESS?
Yes. Edit a file to contain:
SET EXPLAIN ON;SELECT ...;
SELECT ...;
SELECT ...;
Then execute "dbaccess yourdatabase yourfile" -- this should leave all the
explain plans in sqexplain.out.
> 3. All my queries are huge in size. So is there a mechanism to set the
> SQL Edit buffer size in dbaccess, as I am getting a error "801: SQL
> Edit buffer is full."
Run them from the command line.
> 4. As in Oracle SQLPLUS (set spool on), is there a way to redirect the
> output to a file in Informix.
OUTPUT TO "filename" SELECT ...;
--
Ciao,
The Obnoxious One
"Ogni uomo mi guarda come se fossi una testa di cazzo"