ODBC driver performance on large result-sets
am 28.05.2008 22:51:23 von Alistair Bayley------=_Part_22871_3748313.1212007883527
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Attached are two C programs. They borh (I believe) execute the same
query against a PostgreSQL database on my WinXP laptop. The libpq
version runs quickly (in a second or less), while the ODBC version
takes about 40 seconds. Also, while the ODBC version is processing,
the memory usage for one of the postgres server processes goes up
quite a bit, to 140M.
Any suggestions as to what's causing the difference? And, is there
something I can do about it?
Thanks,
Alistair
------=_Part_22871_3748313.1212007883527
Content-Type: text/plain; name=manyrows-odbc.c
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fgse0u030
Content-Disposition: attachment; filename=manyrows-odbc.c
CiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8d2luZG93cy5oPgojaW5j
bHVkZSA8c3FsLmg+CiNpbmNsdWRlIDxzcWxleHQuaD4KCgpTUUxSRVRVUk4g
cmM7Cgp2b2lkIHByaW50RGlhZ1JlY3MoU1FMSEFORExFIGgsIFNRTFNNQUxM
SU5UIGh0eXBlLCBTUUxTTUFMTElOVCBtc2dTZXEpCnsKICBjaGFyIHN0clN0
YXRlWzIwXTsKICBjaGFyIHN0ck1zZ1sxMDI1XTsKICBTUUxJTlRFR0VSIGVy
ck51bTsKICBTUUxTTUFMTElOVCBtc2dMZW47CiAgU1FMUkVUVVJOIHJjMjsK
ICByYzIgPSBTUUxHZXREaWFnUmVjKGh0eXBlLCBoLCBtc2dTZXEsIHN0clN0
YXRlLCAmZXJyTnVtLCBzdHJNc2csIDEwMjQsICZtc2dMZW4pOwogIGlmIChT
UUxfU1VDQ0VTUyA9PSByYzIpCiAgewogICAgcHJpbnRmKCIlZCAlcyAlc1xu
IiwgZXJyTnVtLCBzdHJTdGF0ZSwgc3RyTXNnKTsKICAgIHByaW50RGlhZ1Jl
Y3MoaCwgaHR5cGUsIG1zZ1NlcSsxKTsKICB9CiAgLyogZWxzZSB7IHByaW50
ZigicH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gnKSIpOwogIC8vcHJpbnRm
KCJleGVjdXRlU3RtdFxuIik7CiAgLy9leGVjdXRlU3RtdChzdG10KTsKCiAg
cHJpbnRmKCJwcmVwYXJlU3RtdFxuIik7CiAgcHJlcGFyZVN0bXQoc3RtdCwg
bWFueVJvd3MyKTsKICBwcmludGYoImV4ZWN1dGVTdG10XG4iKTsKICBleGVj
dXRlU3RtdChzdG10KTsKCiAgaW50IGNvbDFCdWY7CiAgU1FMTEVOIGNvbDFT
ejsKICBiaW5kQ29sSW50KHN0bXQsIDEsICZjb2wxQnVmKTsKCiAgZmV0Y2go
c3RtdCk7CiAgaW50IHJvd2NvdW50ID0gMDsKICB3aGlsZSAocmMgPT0gU1FM
X1NVQ0NFU1MpCiAgewogICAgcm93Y291bnQrKzsKICAgIGZldGNoKHN0bXQp
OwogIH0KCiAgcHJpbnRmKCJyb3djb3VudDogJWRcbiIsIHJvd2NvdW50KTsK
CiAgcHJpbnRmKCJmcmVlU3RtdFxuIik7CiAgZnJlZVN0bXQoc3RtdCk7CiAg
cHJpbnRmKCJkaXNjb25uZWN0XG4iKTsKICBvZGJjX2Rpc2Nvbm5lY3QoY29u
bik7CiAgcHJpbnRmKCJmcmVlQ29ublxuIik7CiAgZnJlZUNvbm4oY29ubik7
CiAgcHJpbnRmKCJmcmVlRW52XG4iKTsKICBmcmVlRW52KGVudik7Cn0KCgpp
bnQgbWFpbihpbnQgYXJnYywgY2hhcioqIGFyZ3YpCnsKICBydW5UZXN0KCJE
U049cG9zdGdyZXMiKTsKfQo=
------=_Part_22871_3748313.1212007883527
Content-Type: text/plain; name=manyrows-libpq.c
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fgse0uol1
Content-Disposition: attachment; filename=manyrows-libpq.c
I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5j
bHVkZSAibGlicHEtZmUuaCINCg0Kc3RhdGljIHZvaWQgZXhpdF9uaWNlbHko
UEdjb25uICpjb25uK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lvbiB0byB0aGUgZGF0YWJhc2Ug
YW5kIGNsZWFudXAgKi8NCiAgIFBRZmluaXNoKGNvbm4pOw0KDQogICByZXR1
cm4gMDsNCn0NCg==
------=_Part_22871_3748313.1212007883527
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
--=20
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
------=_Part_22871_3748313.1212007883527--