Skip site navigation (1) Skip section navigation (2)

Re: remote database queries

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joe Conway <joe(dot)conway(at)mail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: remote database queries
Date: 2001-06-14 16:48:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-interfaces
Added to /contrib.  Thanks.

> > Until we fix that (maybe for 7.2, maybe not) your existing hack is
> > probably pretty reasonable.  You could save some cycles by avoiding
> > conversion to text, though --- instead return an opaque datum that is
> > pointer-to-tuple-slot and let the dblink_tok function extract fields
> > from the tuple.  Look at SQL function support and the FieldSelect
> > expression node type for inspiration.
> >
> I changed the dblink() function to return a pointer instead of concatenated
> text, and dblink_tok() to use the pointer. FWIW, a query on a small (85
> tuples) remote (a second PC on a 100baseT subnet) table takes about 34
> milliseconds (based on show_query_stats) versus about 4 milliseconds when
> run locally. It actually takes a bit longer (~65 milliseconds) when run
> against a second database on the same PC. The original text parsing version
> was about 25% slower.
> Although shifting from text parsing to pointer passing is more efficient, I
> have one more question regarding this -- for now ;) -- is there any way to
> check the pointer passed to dblink_tok() to be sure it came from dblink()?
> Thanks,
> -- Joe

[ Attachment, skipping... ]

> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-14 17:13:04
Subject: Re: Removal of temp tables
Previous:From: Bruce MomjianDate: 2001-06-14 16:36:48
Subject: Re: Removal of temp tables

pgsql-interfaces by date

Next:From: Tabor KellyDate: 2001-06-15 19:00:40
Subject: NULL feilds and ERROR messages from libpq++
Previous:From: Dave CramerDate: 2001-06-14 14:25:59
Subject: Re: [JDBC] Trouble with 7.1.2 JDBC driver

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group