cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL Console (ADT) fires additional query which takes a long time to execute

NemanjaSimovic
Participant
1,106

Hi,

I'm executing in SQL Console following script:

 

select ds~vbeln, dh~kunnr, dh~kunag, p~parnr
from likpuk as ds
join likp as dh on dh~vbeln = ds~vbeln
left join vbpa as p on p~vbeln = ds~vbeln and p~posnr = '000000' and p~parvw = 'RE'
where dh~erdat  >= '20240101'
  and dh~kunnr > '0000000000'
  and dh~kunag > '0000000000'

 

Looks like very simple, isn't it. 😉

But the SQL console don't execute just mine query (noticed in ST05). No, it wants first to count the rows! 😲Why?NemanjaSimovic_1-1732190658802.png

And that kind of inquiry costs 35 seconds every time, as you can see below:

NemanjaSimovic_0-1732190579745.png

Is there a way to avoid this SELECT COUNT(*)?

ADT team please respond if possible? Placing a ticket to you is still a mystery to me. 🔮

Regards,
Nemanja

Accepted Solutions (1)

Accepted Solutions (1)

NemanjaSimovic
Participant
0 Likes

Anyhow, this issue is solved. Thanks ADT Team! 👍 Going to close the topic.

Answers (1)

Answers (1)

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert

There is a number of "rows retrieved" in SQL console, so I bet it must be done by this separate SELECT COUNT.

adt-console-sql.png

Not sure why ADT just not counts rows of the "original" SELECT?

NemanjaSimovic
Participant
0 Likes

I guess it's because it sends "up to 100 rows", and I'm not sure will DB (Oracle in my case) be polite and return total number of queried rows. 😀 But when I click on "Number of Entries" button it shows exact number or rows. Maybe they could put SELECT COUNT(*) upon that button is pressed? It's a question for design. 😉