Re: 3 round trips over network for simply "select sysdate from dual"

I am surprised it only takes 3.

Hard to say what OCI is doing in the background of SQL Plus my guess it is doing a 'describe' first then an 'execute' and 'fetch'.
Which would account for the three round trips.

check out this link

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/ociacrou.htm

which details the round trips that OCI uses, how one translates that into what SQLPlus implements is anyones guess.

I could just as well be doing a |OCIPing first or a ||OCISessionBegin for that matter.

The only way to find out is to talk to one of the Programmers who wrote SQLPlus
|

qihua wu wrote:
Hi, all

When using tcpdump to check what happen over the network when do a simple query as
SQL> select sysdate from dual;

SYSDATE
---------
20-JUN-08

The tcpdump is as following, 3 round trips between the server and client. Why so many trips? Don't we only need to 1 round trip as client send the query and the server reply? 16:56:13.354672 IP host1 > host2.1580: . 7898:8 054(156) ack 6755 win 32768
16:56:13.354683 IP host2.1580 > host1: . 6755:6 836(81) ack 8054 win 32768
16:56:13.521731 IP host1 > host2.1580: . 8054:8 126(72) ack 6836 win 32768
16:56:13.521744 IP host2.1580 > host1: . 6836:6 853(17) ack 8126 win 32768
16:56:13.688967 IP host1 > host2.1580: . 8126:8 141(15) ack 6853 win 32768
16:56:13.688980 IP host2.1580 > host1: . 6853:6 874(21) ack 8141 win 32768


And the expert says below: one additional roundtrip to initiate the query. Don't quite understand why we need additional roundtrip to initiate.
http://www.adp-gmbh.ch/ora/sqlplus/arraysize.html

Thanks,
Qihua
--
http://www.freelists.org/webpage/oracle-l


Other related posts: