Wednesday, March 7, 2012

Problem with reading in packet mode

Hi,
I'm using the following environment:
OS: Windows XP professional
SQL Server ODBC driver version: 2000.85.1117.00
RDBMS: SQL Server 2000
I have a question about reading a table in packet mode
using ODBC (i.e. using SQL_ROWSET_SIZE statement option).
I performed the following scenario:
1. I created a table with one int column (e.g. CREATE TABLE [TREAD] (Field1
int NULL))
2. I populated this table with 1 million records
3. I wrote a small basic ODBC application (console application using
Microsoft Visual C++ 6) to simply
read these records with minimum overhead (i.e. no other expensive
operations, no extensive console text output, etc.),
see attached sample.
4. Within this ODBC application, I'm reading/fetching all the records using
SQL_ROWSET_SIZE with value 10 (i.e. packet mode).
The problem is the following:
The relevant code for setting the packet mode is as follows, see attached
sample:
//...
//rc = SQLSetStmtOption(StmtHandle, SQL_ROWSET_SIZE, 10);
rc = SQLExecDirect(StmtHandle, SQLStmt, SQL_NTS);
rc = SQLSetStmtOption(StmtHandle, SQL_ROWSET_SIZE, 10);
//...
If SQLSetStmtOption() is called after SQLExecDirect(), the reading is very
fast, i.e. 1 sec.
If SQLSetStmtOption() is called before SQLExecDirect(), the reading is very
slow, i.e. 49 secs.
My question: which is the right call order ? So far, from the ODBC official
docs, I understand that
SQLSetStmtOption() can be called before and/or after SQLExecDirect() and, at
least in this case, it
shouldn't make any difference. I don't try to use different rowset/packet
sizes during reading, I just
try to read all records with a certain packet size (e.g. 10) from the very
beginning to the end.
Thanks for your help,
Ovidiu
begin 666 TestReadPacket.cpp
M+R]T97-T(')E860@.<&%C:V5T#0H-"B-I;F-L=61E(#QW:6YD;W=S+F@.^#0HC
M:6YC;'5D92 \<W%L+F@.^#0HC:6YC;'5D92 \<W%L97AT+F@.^#0HC:6YC;'5D
M92 \:6]S=')E86TN:#X-"B-I;F-L=61E(#QS=')I;F<N:#X-"B-I;F-L=61E
M(#QM871H+F@.^#0HC:6YC;'5D92 \=&EM92YH/@.T*#0IC;&%S<R!/1$)#7T-L
M87-S#0I[#0H@.(" @.<'5B;&EC.@.T*(" @.(" @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E+" P+"!S
M=')3=&%T92P@.)G-Q;$1B0V]D92P@.<W1R1&)-97-S86=E+"!344Q?34%87TU%
M4U-!1T5?3$5.1U1(("T@.,2 L("9C8F5R<F]R;7-G("D[#0H)"0T*"0EI9B H
M(')C(#T](%-13%]354-#15-3("D-"@.D)>PT*"0D)<W1R8V%T*'-T<BP@.*&-O
M;G-T(&-H87(J*2!S=')3=&%T92D[#0H)"0ES=')C870H<W1R+" B(" B*3L-
M"@.D)"7-T<F-A="AS='(L("AC;VYS="!C:&%R*BD@.<W1R1&)-97-S86=E*3L-
M"@.D)?0T*"7T@.=VAI;&4H(')C(#T](%-13%]354-#15-3("D[#0H)#0H)8V]U
M=" \/" B17)R;W(@.;65S<V%G93H@.(B \/"!E;F1L.PT*"6-O=70@./#P@.<W1R
M(#P\(&5N9&P[#0I]#0H-"G9O:60@.;6%I;B@.I#0I[#0H)=&EM95]T('-T87)T
M.PT*"71I;65?="!E;F0[#0H-"@.ET:6UE*"9S=&%R="D[#0H-"B @.("!2151#
M3T1%("!R8R ](%-13%]354-#15-3.PT*(" @.(%-13$-(05(@.($1"3F%M95LR
M,%T@./2 B4U%,,C P,"([#0H@.(" @.4U%,0TA!4B @.4U%,4W1M=%LR-35=.PT*
M#0H@.(" @.3T1"0U]#;&%S<R @.17AA;7!L93L-"@.T*(" @.(&EF("A%>&%M<&QE
M+D-O;DAA;F1L92 A/2!.54Q,*0T*(" @.('L-"B @.(" @.(" @.<F,@./2!344Q#
M;VYN96-T*$5X86UP;&4N0V]N2&%N9&QE+"!$0DYA;64L(%-13%].5%,L( T*
M(" @.(" @.(" @.(" @.(" @.(" H4U%,0TA!4B J*2 B<FYD9&(U(BP@.4U%,7TY4
M4RP@.*%-13$-(05(@.*BD@.(F]V:61I=2(L(%-13%].5%,I.PT*#0H@.(" @.(" @.
M(')C(#T@.4U%,06QL;V-3=&UT*$5X86UP;&4N0V]N2&%N9&QE+" F17AA;7!L
M92Y3=&UT2&%N9&QE*3L-"@.T*(" @.(" @.("!I9B H<F,@./3T@.4U%,7U-50T-%
M4U,@.?'P@.<F,@./3T@.4U%,7U-50T-%4U-?5TE42%])3D9/*0T*(" @.(" @.("![
M#0H@.(" @.(" @.(" @.("!S=')C<'DH*&-H87(@.*BD@.4U%,4W1M="P@.(E-%3$5#
M5"!&:65L9#$@.1E)/32!44D5!1"(I.PT*#0H)"0ER8R ](#HZ4U%,4V5T4W1M
M=$]P=&EO;BA%>&%M<&QE+E-T;71(86YD;&4L(%-13%]23U=3151?4TE:12P@.
M,3 I.PD-"@.D)"7)C(#T@.4U%,17AE8T1I<F5C="A%>&%M<&QE+E-T;71(86YD
M;&4L(%-13%-T;70L(%-13%].5%,I.PT*"0D)+R]R8R ](#HZ4U%,4V5T4W1M
M=$]P=&EO;BA%>&%M<&QE+E-T;71(86YD;&4L(%-13%]23U=3151?4TE:12P@.
M,3 I.PD-"@.T*(" @.(" @.(" @.(" @.:68@.*')C(#T](%-13%]354-#15-3*0T*
M(" @.(" @.(" @.(" @.(" @.($5X86UP;&4N4VAO=U)E<W5L=',H*3L-"@.T*(" @.
M(" @.(" @.(" @.:68@.*$5X86UP;&4N4W1M=$AA;F1L92 A/2!.54Q,*0T*(" @.
M(" @.(" @.(" @.(" @.(')C(#T@.4U%,1G)E95-T;70H17AA;7!L92Y3=&UT2&%N
M9&QE+"!344Q?1%)/4"D[#0H@.(" @.(" @.('T-"@.D)96QS90T*"0E[#0H)"0E%
M>&%M<&QE+E!R:6YT17)R;W(H*3L-"@.D)?0T*#0H@.(" @.(" @.(')C(#T@.4U%,
M1&ES8V]N;F5C="A%>&%M<&QE+D-O;DAA;F1L92D[#0H@.(" @.?0T*#0H)=&EM
M92@.F96YD*3L-"@.T*"6-O=70@./#P@.(G1I;64@.96QA<'-E9" ]("(@./#P@.96YD
F("T@.<W1A<G0@./#P@.(B!S96-O;F1S(B \/"!E;F1L.PT*?0T*#0H`
`
end
Hi Ovidiu,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you call SQLSetStmtOption() before
SQLExecDirect() the performance is quite poor. If there is any
misunderstanding, please feel free to let me know.
Yes, as you know, the SQLSetStmtOption can be called before/after
SQLExecDirect. However, from ODBC 3.x SQLSetStmtOption is deprecated. It
has been replaced by SQLSetStmtAttr. So I suggest you try to use
SQLSetStmtAttr to see if performance goes better. Please check the
following link for more information.
http://msdn.microsoft.com/library/de...us/odbc/htm/od
bcsqlsetstmtoption.asp
If that still doens't work, please feel free to reply to the post.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
|||Hi Kevin,
Thank you for your quick reply.
I did try using the new functions: SQLSetStmtAttr instead of
SQLSetStmtOption and SQLFetchScroll instead of SQLExtendedFetch
respectively,
and still the problem is absolutely the same.
I attached a revised sample.
Thanks,
Ovidiu
"Kevin Yu [MSFT]" <v-kevy@.online.microsoft.com> wrote in message
news:byomeErhFHA.940@.TK2MSFTNGXA01.phx.gbl...
> Hi Ovidiu,
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that when you call SQLSetStmtOption()
> before
> SQLExecDirect() the performance is quite poor. If there is any
> misunderstanding, please feel free to let me know.
> Yes, as you know, the SQLSetStmtOption can be called before/after
> SQLExecDirect. However, from ODBC 3.x SQLSetStmtOption is deprecated. It
> has been replaced by SQLSetStmtAttr. So I suggest you try to use
> SQLSetStmtAttr to see if performance goes better. Please check the
> following link for more information.
> http://msdn.microsoft.com/library/de...us/odbc/htm/od
> bcsqlsetstmtoption.asp
> If that still doens't work, please feel free to reply to the post.
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
begin 666 TestReadPacketNew.cpp
M+R]T97-T(')E860@.<&%C:V5T#0H-"B-I;F-L=61E(#QW:6YD;W=S+F@.^#0HC
M:6YC;'5D92 \<W%L+F@.^#0HC:6YC;'5D92 \<W%L97AT+F@.^#0HC:6YC;'5D
M92 \:6]S=')E86TN:#X-"B-I;F-L=61E(#QS=')I;F<N:#X-"B-I;F-L=61E
M(#QM871H+F@.^#0HC:6YC;'5D92 \=&EM92YH/@.T*#0IC;&%S<R!/1$)#7T-L
M87-S#0I[#0H@.(" @.<'5B;&EC.@.T*(" @.(" @.("!(14Y6(" @.("!%;G9(86YD
M;&4[#0H@.(" @.(" @.($A$0D,@.(" @.($-O;DAA;F1L93L-"B @.(" @.(" @.2%-4
M350@.(" @.4W1M=$AA;F1L93L@.#0H@.(" @.(" @.(%)%5$-/1$4@.(')C.PT*#0H@.
M(" @.<'5B;&EC.@.T*(" @.(" @.("!/1$)#7T-L87-S*"D[#0H@.(" @.(" @.('Y/
M1$)#7T-L87-S*"D[#0H@.(" @.(" @.(%)%5$-/1$4@.(%-H;W=297-U;'1S*"D[
M(" -"@.D)=F]I9"!0<FEN=$5R<F]R*"D[#0I].PT*#0I/1$)#7T-L87-S.CI/
M1$)#7T-L87-S*"D-"GL-"B @.("!R8R ](%-13%]354-#15-3.PT*#0H@.(" @.
M<F,@./2!344Q!;&QO8T5N=B@.F16YV2&%N9&QE*3L-"@.T*(" @.(&EF("AR8R ]
M/2!344Q?4U5#0T534RD-"B @.(" @.(" @.<F,@./2!344Q!;&QO8T-O;FYE8W0H
M16YV2&%N9&QE+" F0V]N2&%N9&QE*3L-"GT-"@.T*3T1"0U]#;&%S<SHZ?D]$
M0D-?0VQA<W,H*0T*>PT*(" @.(&EF("A#;VY(86YD;&4@.(3T@.3E5,3"D-"B @.
M(" @.(" @.4U%,1G)E94-O;FYE8W0H0V]N2&%N9&QE*3L-"@.T*(" @.(&EF("A%
M;G9(86YD;&4@.(3T@.3E5,3"D-"B @.(" @.(" @.4U%,1G)E945N=BA%;G9(86YD
M;&4I.PT*?0T*#0I2151#3T1%($]$0D-?0VQA<W,Z.E-H;W=297-U;'1S*'9O
M:60I#0I[#0H)4D540T]$10D@.<F,@./2 P.PD-"B @.("!344Q)3E1%1T52(" @.
M1FQD07)R87E;,3!=.PT*"5-13$E.5$5'15(@.("!);F1!<G)A>5LQ,%T[#0H-
M"B @.("!344Q54TU!3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86UP;&4N0V]N2&%N9&QE("$]($Y53$PI#0H@.(" @.
M>PT*(" @.(" @.("!R8R ](%-13$-O;FYE8W0H17AA;7!L92Y#;VY(86YD;&4L
M($1"3F%M92P@.4U%,7TY44RP@.#0H@.(" @.(" @.(" @.(" @.(" @.("A344Q#2$%2
M("HI(")R;F1D8C4B+"!344Q?3E13+" H4U%,0TA!4B J*2 B;W9I9&EU(BP@.
M4U%,7TY44RD[#0H-"B @.(" @.(" @.<F,@./2!344Q!;&QO8U-T;70H17AA;7!L
M92Y#;VY(86YD;&4L("9%>&%M<&QE+E-T;71(86YD;&4I.PT*#0H@.(" @.(" @.
M(&EF("AR8R ]/2!344Q?4U5#0T534R!\?"!R8R ]/2!344Q?4U5#0T534U]7
M251(7TE.1D\I#0H@.(" @.(" @.('L-"B @.(" @.(" @.(" @.('-T<F-P>2@.H8VAA
M<B J*2!344Q3=&UT+" B4T5,14-4($9I96QD,2!&4D]-(%1214%$(BD[#0H-
M"@.D)"7)C(#T@.4U%,4V5T4W1M=$%T='(H17AA;7!L92Y3=&UT2 &%N9&QE+"!3
M44Q?05144E]23U=?05)205E?4TE:12P@.*%-13%!/24Y415(I($%R<F%Y4VEZ
M92P@.,"D[#0H-"@.D)"2\O<F,@./2 Z.E-13%-E=%-T;71/<'1I;VXH17AA;7!L
M92Y3=&UT2&%N9&QE+"!344Q?4D]74T547U-)6D4L(#$P*3L)#0H)"0ER8R ]
M(%-13$5X96-$:7)E8W0H17AA;7!L92Y3=&UT2&%N9&QE+"!344Q3=&UT+"!3
M44Q?3E13*3L-"@.D)"2\O<F,@./2 Z.E-13%-E=%-T;71/<'1I;VXH17AA;7!L
M92Y3=&UT2&%N9&QE+"!344Q?4D]74T547U-)6D4L(#$P*3L)#0H-"@.D)"2\O
M<F,@./2!344Q39713=&UT071T<BA%>&%M<&QE+E-T;71(86YD;&4L(%-13%]!
M5%127U)/5U]!4E)!65]325I%+" H4U%,4$])3E1%4BD@.07)R87E3:7IE+" P
M*3L-"@.T*(" @.(" @.(" @.(" @.:68@.*')C(#T](%-13%]354-#15-3*0T*(" @.
M(" @.(" @.(" @.(" @.($5X86UP;&4N4VAO=U)E<W5L=',H*3L-"@.T*(" @.(" @.
M(" @.(" @.:68@.*$5X86UP;&4N4W1M=$AA;F1L92 A/2!.54Q,*0T*(" @.(" @.
M(" @.(" @.(" @.(')C(#T@.4U%,1G)E95-T;70H17AA;7!L92Y3=&UT2&%N9&QE
M+"!344Q?1%)/4"D[#0H@.(" @.(" @.('T-"@.D)96QS90T*"0E[#0H)"0E%>&%M
M<&QE+E!R:6YT17)R;W(H*3L-"@.D)?0T*#0H@.(" @.(" @.(')C(#T@.4U%,1&ES
M8V]N;F5C="A%>&%M<&QE+D-O;DAA;F1L92D[#0H@.(" @.?0T*#0H)=&EM92@.F
M96YD*3L-"@.T*"6-O=70@./#P@.(G1I;64@.96QA<'-E9" ]("(@./#P@.96YD("T@.
C<W1A<G0@./#P@.(B!S96-O;F1S(B \/"!E;F1L.PT*?0T*#0H`
`
end
|||Hi Ovidiu,
What is the version of MDAC on your machine? Please try to upgrade to the
latest version MDAC 2.8 sp1 from the following link to see if it can
resolved the problem.
http://www.microsoft.com/downloads/d...895-efc2-4f8e-
a9e0-3a1afbd5922e&DisplayLang=en
Also I suggest you try to set to a larger packet size (e.g. 512).
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
|||Hi Kevin,
Yes, I have the latest MDAC version: MDAC 2.8 SP1 on WINDOWS XP SP2.
It's true, the performance gets much better when we increase the packet size
(we already knew that), as follows:
- for packet size 512 I get aprox. 7 secs (compared to 49 secs)
- increasing packet size over 512 won't improve performance anymore
The bottom line is: even when using larger values for the packet size,
performance is still poor compared
to the case when SQLSetStmtOption is called after SQLExecDirect (7 secs vs.
1 sec). Why is that happening ?
So, increasing packet size is a good workaround but up to a point.
There is the following bussiness impact: the customers using our application
are asking questions about this (strange) behaviour. Is there any
Microsoft doc, release note, etc. that refers to it ?
Could this issue be escalated such that, at least, we could get an official
answer from Microsoft regarding this behaviour. This would prove at
least that we are not misusing the ODBC API in any way (this was our main
concern in the first place because, actually, the order of ODBC
calls causes this strange behaviour).
Your help is appreciated.
Regards,
Ovidiu
"Kevin Yu [MSFT]" <v-kevy@.online.microsoft.com> wrote in message
news:hYsGn42hFHA.944@.TK2MSFTNGXA01.phx.gbl...
> Hi Ovidiu,
> What is the version of MDAC on your machine? Please try to upgrade to the
> latest version MDAC 2.8 sp1 from the following link to see if it can
> resolved the problem.
> http://www.microsoft.com/downloads/d...895-efc2-4f8e-
> a9e0-3a1afbd5922e&DisplayLang=en
> Also I suggest you try to set to a larger packet size (e.g. 512).
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
|||Hi Ovidiu,
Here, I suggest you try to use 4096 as the packet size to see if there is
any performance increment.. To get an official answer from Microsoft, you
need to contact PSS for professional support. You can find the contact
information from the following link:
http://support.microsoft.com/common/...gp;en-us;offer
prophone
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
|||Hi Kevin,
As I already specified in my previous reply, increasing packet size over a
certain limit won't improve performance anymore.
Thanks for your help. I will try to escalate this issue through PSS.
Regards,
Ovidiu
"Kevin Yu [MSFT]" <v-kevy@.online.microsoft.com> wrote in message
news:clVPgQDiFHA.3120@.TK2MSFTNGXA01.phx.gbl...
> Hi Ovidiu,
> Here, I suggest you try to use 4096 as the packet size to see if there is
> any performance increment.. To get an official answer from Microsoft, you
> need to contact PSS for professional support. You can find the contact
> information from the following link:
> http://support.microsoft.com/common/...gp;en-us;offer
> prophone
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
|||Hi Ovidiu,
Sorry that I could not provide further assistance on this issue. Good luck!
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

No comments:

Post a Comment