Thread:

From
viswam mamilla
Date:
Hi,
This is viswam.

Iam using PostgreSQL 9.1 in my local system.when iam using this database
with vb.net my application gets very slow while retriving data from
database.if i used the same with access or SQL database its is very fast.

Can i know what is the problem.Iam using ODBC Connection for postgresql.

here iam writing one sample table in postgresql.

CREATE TABLE "AppUsers"
(
  "UserID" smallint,
  "Name" character(100),
  "EmailID" character(150),
  "Password" character(20),
  "UserRole" character(50)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE "AppUsers"
  OWNER TO postgres;

Re:

From
John R Pierce
Date:
On 2/9/2013 3:25 AM, viswam mamilla wrote:
> Iam using PostgreSQL 9.1 in my local system.when iam using this
> database with vb.net <http://vb.net> my application gets very slow
> while retriving data from database.if i used the same with access or
> SQL database its is very fast.
>
> Can i know what is the problem.Iam using ODBC Connection for postgresql.

you'd likely be better off with npgsql, which is a native .net data
provider for postgres, instead of ODBC.

>
> here iam writing one sample table in postgresql.
>
> CREATE TABLE "AppUsers"
> (
>   "UserID" smallint,
>   "Name" character(100),
>   "EmailID" character(150),
>   "Password" character(20),
>   "UserRole" character(50)
> )

you realize 'character(n)' are fixed length fields?   so if name is 'joe
blow', it will be padded to 100 characters with spaces?   thats almost
never what you want to do.  instead use varchar(100) or character
varying(100) (same thing), or just use text (no length specified), these
formats return just what you store ('joe blow' will return an 8 char
string).



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast