Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You are lost in the Swamps of Despair.


computers / comp.sys.tandem / Re: How to check SQL Estimate cost on OSS

SubjectAuthor
* How to check SQL Estimate cost on OSSMemmedaga Memmedov
`* Re: How to check SQL Estimate cost on OSSKeith Dick
 `* Re: How to check SQL Estimate cost on OSSMemmedaga Memmedov
  `- Re: How to check SQL Estimate cost on OSSKeith Dick

1
How to check SQL Estimate cost on OSS

<07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=539&group=comp.sys.tandem#539

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:620a:2844:b0:6b8:5f52:a6b5 with SMTP id h4-20020a05620a284400b006b85f52a6b5mr1929407qkp.351.1661408046641;
Wed, 24 Aug 2022 23:14:06 -0700 (PDT)
X-Received: by 2002:a05:620a:198e:b0:6bb:7651:fc7 with SMTP id
bm14-20020a05620a198e00b006bb76510fc7mr1924186qkb.376.1661408046470; Wed, 24
Aug 2022 23:14:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 24 Aug 2022 23:14:06 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=185.220.152.249; posting-account=nVVCRgoAAACrQkyRv5XcWnnembs0sPhF
NNTP-Posting-Host: 185.220.152.249
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com>
Subject: How to check SQL Estimate cost on OSS
From: mkele...@gmail.com (Memmedaga Memmedov)
Injection-Date: Thu, 25 Aug 2022 06:14:06 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1436
 by: Memmedaga Memmedov - Thu, 25 Aug 2022 06:14 UTC

Hi,
I use "sqlcomp/in xxx/xxxo" command to see cost of sql sentences on Guardian, I mean estimate cost. I make sql compiler all of the object file into a text file and cobol programme read "estimate cost:" sentences and check values.

On OSS system, we use java programme language and create .jar files and bathc system run this .jar file.
Now I wanto to learn estimate cost of sql sentences in java code, is it possible.
Thanks.

Re: How to check SQL Estimate cost on OSS

<1276417f-422a-4969-9fa0-328e7f2305b5n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=540&group=comp.sys.tandem#540

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:178e:b0:344:56a8:25da with SMTP id s14-20020a05622a178e00b0034456a825damr1514049qtk.375.1661553263099;
Fri, 26 Aug 2022 15:34:23 -0700 (PDT)
X-Received: by 2002:a05:6214:21a5:b0:497:f82:3a25 with SMTP id
t5-20020a05621421a500b004970f823a25mr1523351qvc.48.1661553262953; Fri, 26 Aug
2022 15:34:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Fri, 26 Aug 2022 15:34:22 -0700 (PDT)
In-Reply-To: <07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.42.228.104; posting-account=Lua_ZwoAAADivbVXQF8uKE7dZSUNm9vj
NNTP-Posting-Host: 98.42.228.104
References: <07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1276417f-422a-4969-9fa0-328e7f2305b5n@googlegroups.com>
Subject: Re: How to check SQL Estimate cost on OSS
From: rkd...@gmail.com (Keith Dick)
Injection-Date: Fri, 26 Aug 2022 22:34:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 61
 by: Keith Dick - Fri, 26 Aug 2022 22:34 UTC

On Wednesday, August 24, 2022 at 11:14:07 PM UTC-7, Memmedaga Memmedov wrote:
> Hi,
> I use "sqlcomp/in xxx/xxxo" command to see cost of sql sentences on Guardian, I mean estimate cost. I make sql compiler all of the object file into a text file and cobol programme read "estimate cost:" sentences and check values.
>
> On OSS system, we use java programme language and create .jar files and bathc system run this .jar file.
> Now I wanto to learn estimate cost of sql sentences in java code, is it possible.
> Thanks.

Since no one else has tried to answer yet, I will step in with what I think is the answer.

In short, if I understand your question, you cannot do that with Java programs.

For COBOL, C, or TAL program that use embedded SQL on the NonStop system, the language compiler takes the SQL statements, saves them in a special part of the object file, and replaces the SQL statements with calls to the SQL executor procedures that will carry out the actions the SQL statement requests. Later, when the SQL Compiler is used to compile the SQL statements that are in the object file, the SQL compiler gets those statements from that special part of the object file, compiles each statement, and places each compiled query plan in another special part of the object file. When you run the program, when execution reaches the spot where there was an embedded SQL statement, the SQL executor is called, it finds the compiled query plan for the statement that was originally at that spot in the program, and performs the steps of the query plan.

When you run SQLCOMP and ask it to do EXPLAIN PLAN from the object file, it locates the compiled query plans from the special part of the object file where they are stored, and displays them in human-readable form.

For your Java programs, if they are using the usual JDBC classes to perform the SQL statements, there is nothing in the Java compiler that recognizes embedded SQL statements -- they are just character strings that get passed to some methods of the JDBC classes. There is no special place in the compiled Java code that holds either the SQL statements nor the compiled query plans. So there is no way to have a program interpret the compiled query plans from a Java jar file (because there are no compiled query plans there).. SQL statements in a Java program are only compiled at execution time.

You are not completely unable to look at the query plans that your Java program uses. You can find the SQL statements in your Java program, get to a TACL prompt, run SQLCI, and use its EXPLAIN command to get SQLCI to display the query plan for each of the SQL statements you found in the Java program, one at a time. That is not as convenient as you can do with SQL statement in a COBOL program, but it is possible to do that.

You must take care if the table names are not fully qualified in the Java code to be sure the defaults in effect when you run the EXPLAIN commands match what would be in effect when you run the Java program, so the SQL compiler references the same tables.

If the Java program composes the SQL statements by combining several Strings to make up the full SQL statement, that would make it somewhat difficult for you to be sure what the statement that gets executed will be. I don't have any suggestion about how best to deal with that.

Re: How to check SQL Estimate cost on OSS

<15efbaf1-7474-4ef6-b379-fa40ac4e69d4n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=541&group=comp.sys.tandem#541

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:1455:b0:343:58b7:446f with SMTP id v21-20020a05622a145500b0034358b7446fmr23167036qtx.338.1662018218263;
Thu, 01 Sep 2022 00:43:38 -0700 (PDT)
X-Received: by 2002:ac8:4e41:0:b0:343:5c49:951a with SMTP id
e1-20020ac84e41000000b003435c49951amr22344008qtw.25.1662018218033; Thu, 01
Sep 2022 00:43:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 1 Sep 2022 00:43:37 -0700 (PDT)
In-Reply-To: <1276417f-422a-4969-9fa0-328e7f2305b5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=185.220.152.249; posting-account=nVVCRgoAAACrQkyRv5XcWnnembs0sPhF
NNTP-Posting-Host: 185.220.152.249
References: <07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com> <1276417f-422a-4969-9fa0-328e7f2305b5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <15efbaf1-7474-4ef6-b379-fa40ac4e69d4n@googlegroups.com>
Subject: Re: How to check SQL Estimate cost on OSS
From: mkele...@gmail.com (Memmedaga Memmedov)
Injection-Date: Thu, 01 Sep 2022 07:43:38 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 1
 by: Memmedaga Memmedov - Thu, 1 Sep 2022 07:43 UTC

Thanks for your repy, I expected an answer like this. In this case, what I need to do is to write a cobol program that contains the same sql statement for every sql statement I use in the java program.
Then I find out which java program I use for the high costs I have detected as a result of sql compilation.

Re: How to check SQL Estimate cost on OSS

<3d72e876-dc2b-4553-ba4b-f4d1366bed74n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=543&group=comp.sys.tandem#543

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:1651:b0:344:5d06:7449 with SMTP id y17-20020a05622a165100b003445d067449mr25744509qtj.292.1662065090590;
Thu, 01 Sep 2022 13:44:50 -0700 (PDT)
X-Received: by 2002:a25:4a89:0:b0:69b:6924:48ac with SMTP id
x131-20020a254a89000000b0069b692448acmr15579063yba.29.1662065090290; Thu, 01
Sep 2022 13:44:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 1 Sep 2022 13:44:49 -0700 (PDT)
In-Reply-To: <15efbaf1-7474-4ef6-b379-fa40ac4e69d4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.42.228.104; posting-account=Lua_ZwoAAADivbVXQF8uKE7dZSUNm9vj
NNTP-Posting-Host: 98.42.228.104
References: <07efd45b-7938-4412-957a-5995c85a0803n@googlegroups.com>
<1276417f-422a-4969-9fa0-328e7f2305b5n@googlegroups.com> <15efbaf1-7474-4ef6-b379-fa40ac4e69d4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d72e876-dc2b-4553-ba4b-f4d1366bed74n@googlegroups.com>
Subject: Re: How to check SQL Estimate cost on OSS
From: rkd...@gmail.com (Keith Dick)
Injection-Date: Thu, 01 Sep 2022 20:44:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2067
 by: Keith Dick - Thu, 1 Sep 2022 20:44 UTC

On Thursday, September 1, 2022 at 12:43:39 AM UTC-7, Memmedaga Memmedov wrote:
> Thanks for your repy, I expected an answer like this. In this case, what I need to do is to write a cobol program that contains the same sql statement for every sql statement I use in the java program.
> Then I find out which java program I use for the high costs I have detected as a result of sql compilation.

You don't have to write that COBOL program. You can add the word "EXPLAIN" in front of a SQL statement in SQLCI and get what I believe is the same information. Just make sure all the table names in the SQL statement are fully qualified or that your defaults are set to the same as will be used when the statement is executed from the Java program.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor