EXASOL Explain Analyse Query - sql

I want to get the query plan in Exasol database to check the total execution time, memory and cpu usage. Profiling in Exasol is so complex and difficult to understand.
Is there any way to get the query plan like explain analyze in PostgreSQL or any other simple way?
Please explain how to read the query plan in Exasol without executing the query?

You can check the EXASOL User Manual about profiling a query. I agree it's a bit cumbersome :)
Or you can use the scripts I wrote to have an explain like command: exasol-explain

Maybe it will be useful for someone who will try to use EXASOL Explain. There is a script with one missed field in select statement in exasol-explain/scripts/sqlprofile.lua, after temp_db_ram_peak field should follow:
max(PERSISTENT_DB_RAM_PEAK) as PERSISTENT_DB_RAM_PEAK
Otherwise "explain" and "explain_this" return an error "incorrect numbers of result column"

Related

Database: retrieve data before the end of query execution

Can database return partial results like a stream before the end of query execution? i know for some queries with like group by or order by we may need all the information before building the result. But for simple select, is it possible for a database to return data whenever it finds any? If it is, will it still be possible with JDBC.
I'm using Vertica, but it's a general question.
Thank you in advance.

Measure execution time in Altibase DBMS

I need to measure the execution time in a query in the ALTIBASE DBMS.
For example, I need to now in ms the time it took a SELECT * FROM example;
I tried to use the methods that have some traditional DBMS like MySQL or Oracle and doesn't work.
There are some method. The first one you can use the log from altibase to analyze. And the other method is to coding some program that recording time from using the SELECT to get result. Now, I also learn to use altibase - We can together.
I found the solution
After entering to the client with next command isql -u sys -p manager -sysdba you need to execute the next query
SET TIMING ON;
Next the following queries will have the execution time.

How to run a query for a map job only in Apache hive

If I write a query in Apache hive then it executes mapreduce job behind the scene but how I can run only map job in hive?
Thanks
Certain optimized queries do in fact only require a map phase. You may provide a MAPJOIN hint in Hive to achieve same: this is recommended for small secondary tables:
SELECT /*+ MAPJOIN(...) */ * FROM ...
This was a question which was asked to me in an interview,I didn't knew the answer that time but then i figured it out later on.
The following query runs a Map only job.So selecting column values will run map only job.Hence we dont need reducer for this scenario.
select id,salary from tableA;

SQL Performance: LIKE vs IN

In my logging database I have serveral qualifiers specifying the logged action. A few of them are built like 'Item.Action' e.g. 'Customer.Add'. I wonder which approach will be faster if I want to get all logging items that starts with 'Customer.':
SELECT * FROM log WHERE action LIKE 'Customer.%'
or
SELECT * FROM log WHERE action IN ('Customer.Add', 'Customer.Delete', 'Customer.Update', 'Customer.Export', 'Customer.Import')
I use PostgreSql.
Depends on indexes on log table. Most likely - queries will have the same performance. To check - use explain or explain analyze. Queries with the same execution plan (output of explain) will have the same performance.

Get and store execution time in Oracle

Is there a way to get and store the execution time of a select?
select * from table1
Thank you,
Radu.
Oracle provides TIMING command to check the execution time taken for a query.
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-nonstandard.html#timing%20sql%20commands
Tom Kyte has developed a pretty simple test harness called runstats that gives you great timing information.
All SQL statements are stored in V$SQL, but they will age out eventually. ELAPSED_TIME/EXECUTIONS will get you the average time to run the query.