pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Campbell <greg.campbell@us.michelin.com>
To: Brev Patterson <bpatterson@backcountry.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Pg/ODBC driver connection discovery and speed
Date: Fri, 30 Jul 2004 14:53:19 -0400
Message-ID: <410A991F.2070502@us.michelin.com> (raw)
In-Reply-To: <6.1.2.0.0.20040730114621.02401ad0@mail.141.com>
References: <6.1.2.0.0.20040730114621.02401ad0@mail.141.com>

...some Shipping software.
Homegrown? Purchased? Contracted?
I doubt that type of schema discovery is needed for each Update.

I wonder if the "shipping software" is using a recordset update (DAO 
.Edit/.Update or ADO recordset.Update) as opposed to pass-through style  
SQL INSERTS, and UPDATE, which barring a poorly designed database and 
index structure, should be lightning fast.


Brev Patterson wrote:

> Hello list,
>
> I've searched through FAQs, docs, and the mailing list about this 
> problem, but haven't found anything, so I hope this isn't a repeat.
>
> I've got a windows machine running some Shipping software, connected 
> to a postgresql 7.4 database via the Postgres/ODBC driver, behind a 
> secure stunnel connection.
>
> On SELECT's from this windows machine, everything is great:  The 
> driver connects, discovers the info it needs, and then that connection 
> stays open as we do SELECT after SELECT, and it works great.
>
> After the SELECTs, we do UPDATEs back to the database, sending back 
> Tracking # and weight Information.  Instead of connecting, 
> discovering, and then UPDATING on that connection over and over, each 
> UPDATE connection is separate.  So,
> for every UPDATE, there is a new connection, a new discovery, etc.
>
> Now, our database is quite large.  The ODBC driver runs queries like 
> this (this is what I mean by "discovery"):
>
> Jul 30 11:35:05 tenzing postgres[1515]: [253-1] LOG:  statement: 
> select u.nspname, c.relname, a.attname, a.atttypid, t.typname, 
> a.attnum, a.attlen, a.at ttypmod, a.attnotnull,
> Jul 30 11:35:05 tenzing postgres[1515]: [253-2]  c.relhasrules, 
> c.relkind from pg_catalog.pg_namespace u, pg_catalog.pg_class c, 
> pg_catalog.pg_attribute a, pg_catalog.pg_type t
> Jul 30 11:35:05 tenzing postgres[1515]: [253-3]  where u.oid = 
> c.relnamespace and (not a.attisdropped) and c.oid= a.attrelid and 
> a.atttypid = t.oid and (a.attnum > 0) and
> Jul 30 11:35:05 tenzing postgres[1515]: [253-4]  c.relname like 
> 'category_subcat' and u.nspname like 'bcs' order by u.nspname, 
> c.relname, attnum
> Jul 30 11:35:05 tenzing postgres[1515]: [254-1] LOG:  duration: 2.503 ms
>
> on every object/table/etc in our whole database.  This ends up taking 
> 5 to 7 seconds.
>
> Our warehouse workers have to sit there for many seconds after a 
> package has shipped, waiting for each UPDATE connection to do this 
> discovery, before the actual UPDATE is done.  (The actual UPDATE query 
> itself is very fast).
>
> During Christmas, we're going to have so many packages going through, 
> that this delay will kill us.
>
> I'm wondering if any of the possible solutions are available:
>
> 1) Can I force the first UPDATE connection to stay open, meaning only 
> a single discovery set, and then fast UPDATEs right after each other 
> somehow?  Would this be part of the driver, or part of our shipping 
> software?
>
> 2) Can I force the driver to cut down the amount of discovery it 
> does?  Or cache the discovery?  (If I could have it discover only 
> certain pertinent tables, instead of every table and object in our 
> entire database, it would be fast enough to do this on every UPDATE 
> query connection).  I tried creating and connecting a specific 
> database user for this, giving it permissions to only the necessary 
> tables, but those discovery queries still ran on everything in the 
> database.
>
> 3) Are those discovery queries necessary?  Or can we turn them off 
> somehow?
>
> The only option that seems remotely helpful for this would be the 
> option of using Cursors, but we select and update single rows at a 
> time, not many.
>
> thanks for any help or advice,
>
> Brev Patterson
> Backcountry.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

Attachments:

greg.campbell.vcf (text/x-vcard, 281B) download begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America;ENG-IT adr;dom:;;2420 Two Notch Road;Lexington;SC;29071 email;internet:greg.campbell@us.michelin.com title:Systems Engineer tel;work:803-951-5561 tel;fax:803-951-5531 x-mozilla-html:FALSE version:2.1 end:vcard

view thread (2+ messages)

Message-ID: <410A991F.2070502@us.michelin.com>
Permalink:  ../410A991F.2070502@us.michelin.com/
Also on:    postgresql.org/message-id/410A991F.2070502@us.michelin.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: greg.campbell@us.michelin.com, bpatterson@backcountry.com
  Subject: Re: Pg/ODBC driver connection discovery and speed
  In-Reply-To: <410A991F.2070502@us.michelin.com>
  References: <6.1.2.0.0.20040730114621.02401ad0@mail.141.com> <410A991F.2070502@us.michelin.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox