Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Firedac+ODBC+Ingres - get QEP output



Permlink Replies: 9 - Last Post: Oct 2, 2015 10:31 AM Last Post By: Karol Bieniasze...
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 19, 2015 2:09 PM
Hi,

is there a way to get QEP (query execution plan) output from Firedac throught ODBC from [b]Ingres[/b] database?
I tried

FDConnection1.ExecSQL('set printqry');
FDConnection1.ExecSQL('set Lock_Trace');
FDConnection1.ExecSQL('set qep');
FDConnection1.ExecSQL('set trace point qe90');
FDConnection1.ExecSQL('set printrules');

FDQuery1.Active:= false;
FDQuery1.SQL.Text:= 'SELECT * FROM airline';

FDQuery1.Prepare;
FDQuery1.Open();

but i got nothing about QEP

regards,
Karol Bieniaszewski

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 19, 2015 5:42 PM   in response to: Karol Bieniasze... in response to: Karol Bieniasze...
If you will say where it is produced, how it is stored, what API Ingres
provides to get QEP, then I will be able to say - how to get QEP using
FireDAC ODBC bridge driver.

Eg, QEP is produced on server and stored into trace file, or on
client and stored into client trace file, or just SELECT will return
not a table content but QEP.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 10:39 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
If you will say where it is produced, how it is stored, what API Ingres
provides to get QEP, then I will be able to say - how to get QEP using
FireDAC ODBC bridge driver.

Eg, QEP is produced on server and stored into trace file, or on
client and stored into client trace file, or just SELECT will return
not a table content but QEP.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Dmitry Arefiev wrote:
If you will say where it is produced, how it is stored, what API Ingres
provides to get QEP, then I will be able to say - how to get QEP using
FireDAC ODBC bridge driver.

Eg, QEP is produced on server and stored into trace file, or on
client and stored into client trace file, or just SELECT will return
not a table content but QEP.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

Problem that i do not know Ingres internals.
but if you look here
[http://ariel.its.unimelb.edu.au/~yuan/Ingres/us_38697.html]

there is something like this
Less frequently you might want a QEP from a query submitted
through a program. In this case, define an environment
variable that INGRES will translate:

UNIX:C shell:

$ setenv ING_SET "set qep"

UNIX:Bourne shell:

$ ING_SET = "set qep"
$ export ING_SET

VMS: $ define ING_SET "set qep"

regards,
Karol Bieniaszewski

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 12:24 PM   in response to: Karol Bieniasze... in response to: Karol Bieniasze...
Problem that i do not know Ingres internals.

Me too ...

UNIX:C shell:
$ setenv ING_SET "set qep"

That may be "SET ING_SET=set qep" at Win environment.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 1:05 PM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
Problem that i do not know Ingres internals.

Me too ...

UNIX:C shell:
$ setenv ING_SET "set qep"

That may be "SET ING_SET=set qep" at Win environment.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

sorry, i omit that i tested this before
"SET ING_SET=set qep" at Win environment.

nothing happened (or i do not see where it is stored)

regards,
Karol Bieniaszewski
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 1:09 PM   in response to: Karol Bieniasze... in response to: Karol Bieniasze...
nothing happened (or i do not see where it is stored)

Sorry, but see above. Without Ingres installation / knowledge
I doubt that I will be able to help otherwise.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 11:12 PM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
nothing happened (or i do not see where it is stored)

Sorry, but see above. Without Ingres installation / knowledge
I doubt that I will be able to help otherwise.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

You can install Evaluation copy from Actian (if you like to)
http://esd.actian.com/ ->>choose Ingres ->> 10.2 ->> Windows 64

and below you see downloads
http://esd.actian.com/product/Ingres/10.2/Windows_64-Bit/Ingres_10.2_Evaluation_Edition

But you must first register (free) to be able to download

In the meantime it digs through documentation and maybe I can find something

regards,
Karol Bieniaszewski
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 1, 2015 4:48 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
I talk with actian and this is what we should do to get QEP

set environment variables
II_API_SET=printtrace;tracefile c:\mypath\mytrace.log
ING_SET=set qep;set printqry

And this is strange than we can got this info by ODBC when we connect to Ingres throught dbExpress
but with FireDAC this not work.
Any idea why?
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 1, 2015 4:51 AM   in response to: Karol Bieniasze... in response to: Karol Bieniasze...
And this is strange than we can got this info by ODBC when we connect to Ingres throught dbExpress
but with FireDAC this not work.

What means "not work" ? Any exceptions, misbehavior or how else ?
What you are getting with dbExpress and what you does not get with FireDAC ?

PS: Just to clarify - I does not have Ingres and have no plans to install it.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

Edited by: Dmitry Arefiev on Oct 1, 2015 4:16 PM
Karol Bieniasze...

Posts: 10
Registered: 10/1/04
Re: Firedac+ODBC+Ingres - get QEP output
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 2, 2015 10:31 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
What means "not work" ? Any exceptions, misbehavior or how else ?
What you are getting with dbExpress and what you does not get with FireDAC ?

If i set this environment vars only connection throught dbExpress ODBC save trace to file
But "the same" connection by Firedac (ODBC) does not save any data to trace file

this is comment from Actian Corp
"As long as the driver sees II_API_SET it must work. I'm not familiar with Delphi Firedac, but either the variable isn't seen by it or there is some mechanism that resets the environment (similar to the Apache WEB server for example, where you explicitly needs to define the environment variables which should be passed through)

Kristoff
"

regards,
Karol Bieniaszewski

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02