Thread: Sending lot of records
Hi, I have this simple procedure, that it's connecting to a remote DB and it's too slow. It seems an ado problem because if I use pgsql it's very fast. I understand that this query must send only one record, but if I sniff the session (sniffit) I can see that postgres is sending a lot of records, why ??? PD : Postgresql 7.1.3 under freeBSD 4.5-prerelease Thanks a lot Simeó Reig Dim rsConexioDadesGenerals As ADODB.Recordset Dim SQLDadesGenerals As String Set rsConexioDadesGenerals = New ADODB.Recordset ---- identitatinforme is a primary key SQLDadesGenerals = "SELECT nomentitatinforme FROM entitatsinformes WHERE identitatinforme=" & idSocietatActual With rsConexioDadesGenerals .LockType = adLockOptimistic .CursorType = adOpenKeyset .CursorLocation = adUseClient --conexioADO is a global connection .Open SQLDadesGenerals, conexioADO, adOpenDynamic Set AdodcTaulaDadesGenerals.Recordset = rsConexioDadesGenerals End With msgbox AdodcTaulaDadesGenerals.Recordset.recordcount -- return 1
If I make select nomsocietat from entitatsinformes where identitatinforme like '1234'; works (note the semicolon and like) but if I don't put semicolon it's very slow (catch hundreds of rows) . identitatinformes is a primary key but is filled with a sequence, should have to cast to integer ?? why ?? societats=# \d entitatsinformes Table "entitatsinformes" Column | Type | Modifiers -------------------------+------------------------+------------------------- -------------------------------------------- identitatinforme | integer | not null default nextval('"entitatsinfor_identitatinfo_seq"'::text) nomentitatinforme | character varying(75) | not null idadreca | integer | idpoblacio | integer | idtipusadreca | integer | idcarrer | integer | ... snip ... horaultimamodificacio | time | not null default "time"('now'::text) Primary key: entitatsinformes_pkey thanks ! ----- Original Message ----- Sent: Friday, January 04, 2002 11:29 PM Subject: [ODBC] Sending lot of records > Hi, I have this simple procedure, that it's connecting to a remote DB and > it's too slow. It seems an ado problem because if > I use pgsql it's very fast. I understand that this query must send only one > record, but if I sniff the session (sniffit) I can see that > postgres is sending a lot of records, why ??? > > > PD : Postgresql 7.1.3 under freeBSD 4.5-prerelease > > Thanks a lot > Simeó Reig > > > Dim rsConexioDadesGenerals As ADODB.Recordset > Dim SQLDadesGenerals As String > > Set rsConexioDadesGenerals = New ADODB.Recordset > ---- identitatinforme is a primary key > SQLDadesGenerals = "SELECT nomentitatinforme FROM entitatsinformes WHERE > identitatinforme=" & idSocietatActual With rsConexioDadesGenerals > .LockType = adLockOptimistic > .CursorType = adOpenKeyset > .CursorLocation = adUseClient > --conexioADO is a global connection > .Open SQLDadesGenerals, conexioADO, adOpenDynamic > Set AdodcTaulaDadesGenerals.Recordset = rsConexioDadesGenerals > End With > > msgbox AdodcTaulaDadesGenerals.Recordset.recordcount -- return 1 > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
Does this use the Jet engine? I know I can't open dynamic recordsets in Access 2000 with DAO without using Jet, so that might be the culprit for the multiple record transfer. Also = should be faster than like of course. Have you Vacuumed Analysed? If the query performs well under psql then see if you can get an explicit pass-through query maybe? - Stuart -----Original Message----- From: Simeo Reig [mailto:simreig@terra.es] Sent: 04 January 2002 23:35 To: pgsql-odbc@postgresql.org Subject: Re: Sending lot of records If I make select nomsocietat from entitatsinformes where identitatinforme like '1234'; works (note the semicolon and like) but if I don't put semicolon it's very slow (catch hundreds of rows) . identitatinformes is a primary key but is filled with a sequence, should have to cast to integer ?? why ?? societats=# \d entitatsinformes Table "entitatsinformes" Column | Type | Modifiers -------------------------+------------------------+------------------------- -------------------------------------------- identitatinforme | integer | not null default nextval('"entitatsinfor_identitatinfo_seq"'::text) nomentitatinforme | character varying(75) | not null idadreca | integer | idpoblacio | integer | idtipusadreca | integer | idcarrer | integer | ... snip ... horaultimamodificacio | time | not null default "time"('now'::text) Primary key: entitatsinformes_pkey thanks ! ----- Original Message ----- Sent: Friday, January 04, 2002 11:29 PM Subject: [ODBC] Sending lot of records > Hi, I have this simple procedure, that it's connecting to a remote DB and > it's too slow. It seems an ado problem because if > I use pgsql it's very fast. I understand that this query must send only one > record, but if I sniff the session (sniffit) I can see that > postgres is sending a lot of records, why ??? > > > PD : Postgresql 7.1.3 under freeBSD 4.5-prerelease > > Thanks a lot > Simeó Reig > > > Dim rsConexioDadesGenerals As ADODB.Recordset > Dim SQLDadesGenerals As String > > Set rsConexioDadesGenerals = New ADODB.Recordset > ---- identitatinforme is a primary key > SQLDadesGenerals = "SELECT nomentitatinforme FROM entitatsinformes WHERE > identitatinforme=" & idSocietatActual With rsConexioDadesGenerals > .LockType = adLockOptimistic > .CursorType = adOpenKeyset > .CursorLocation = adUseClient > --conexioADO is a global connection > .Open SQLDadesGenerals, conexioADO, adOpenDynamic > Set AdodcTaulaDadesGenerals.Recordset = rsConexioDadesGenerals > End With > > msgbox AdodcTaulaDadesGenerals.Recordset.recordcount -- return 1 > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
Hi, is it possible to receive Notify's from VB ? It seems that isn't possible ! thanks in advance Simeó Reig