Re: foxpro, odbc, data types and unnecessary convertions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fernando Moreno <azazel(dot)7(at)gmail(dot)com>
Cc: PostgreSQL pg-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: foxpro, odbc, data types and unnecessary convertions
Date: 2009-02-25 23:28:44
Message-ID: 6639.1235604524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Fernando Moreno <azazel(dot)7(at)gmail(dot)com> writes:
> For numbers, I have to convert them first to string and then remove
> the spaces, the code looks like this: sql_string = "some sql" +
> alltrim( str( some_number ) ) + " more sql"; I can combine alltrim and
> str in a third function but it's still tricky. A shorter and
> presumably better way to do the same is: sql_string = "some_column =
> ?foxpro_variable ". The problem with the last option is that, watching
> the pgsql log, values are sent this way: '12345'::float(8), so for
> every numeric value, no matter its type, I'm sending 12 characters
> more and the server is doing convertions that I don't need.

> Having a lot of foreign keys and other numeric data, I think this
> behaviour is not so good for network (remote and poor connection) and
> server performance. I'm almost decided to keep doing the trim/str
> thing, but my question is: am I exaggerating? what would you do?

You're obsessing over an issue that is almost certainly not going to
make a measurable difference. You can probably improve your application
performance a lot more by expending the same effort somewhere else.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2009-02-26 01:26:44 Table partitioning and query plans
Previous Message Roderick A. Anderson 2009-02-25 22:25:45 Tangent Ref: Valid characters for user/role/group names?