Re: copy vs. C function

From: idc danny <idcdanny(at)yahoo(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: copy vs. C function
Date: 2011-12-14 07:02:10
Message-ID: 1323846130.44736.YahooMailNeo@web110413.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi guys,
A nub question here since I could not figure it out on my own:
I'm using Hamachi to connect different sites into a VPN and their address always starts with 5.*.*.* - the problem I'm facing is that I cannot make the access restricted to that particular range only.
Currently I got :
host all all 0.0.0.0/32 md5
which allows all the IP's, and the try:
host all all 5.0.0.0/32 md5

does not work.
So what I am suppose to add in "pg_hba.conf" in order to achieve my restriction? Please help me,
Thank you,
Danny

________________________________
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Sent: Wednesday, December 14, 2011 8:18 AM
Subject: Re: [PERFORM] copy vs. C function

Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> writes:
> The only thing I have left are these statements:

> get_call_result_type
> TupleDescGetAttInMetadata
> BuildTupleFromCStrings
> HeapTupleGetDatum
> and finally PG_RETURN_DATUM

> It turns out that:
> get_call_result_type adds 43 seconds [total: 54],
> TupleDescGetAttInMetadata adds 19 seconds [total: 73],
> BuildTypleFromCStrings accounts for 43 seconds [total: 116].

> So those three functions account for 90% of the total time spent.
> What alternatives exist? Do I have to call get_call_result_type /every
> time/ through the function?

Well, if you're concerned about performance then I think you're going
about this in entirely the wrong way, because as far as I can tell from
this you're converting all the field values to text and back again.
You should be trying to keep the values in Datum format and then
invoking heap_form_tuple.  And yeah, you probably could cache the
type information across calls.

            regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Marc Mamin 2011-12-14 09:21:56 Re: Postgres array parser
Previous Message Tom Lane 2011-12-14 06:18:11 Re: copy vs. C function