agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Paul Cole <pcole@ccwf.cc.utexas.edu>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: slow postgres performance
Date: Sun, 27 Aug 1995 20:27:17 -0500 (CDT)
Message-ID: <Pine.LNX.3.91.950827202711.3813B-100000@localhost> (raw)
In-Reply-To: <199508272235.RAA23176@tristero.io.com>



On Sun, 27 Aug 1995, Casey Claiborne wrote:

> Hello -
>         I had downloaded postgres and am using it on a 486 SX 33Mhz machine
> under the Linux 1.2.1 operating system. I am making calls to the postgres
> server from "C" code (I am using embedded sql). I have routines such as
> db_add_user_info, db_get_user_info, db_delete_user info which are written
> very much similar to the one below with the exception that some of the code
> and the queries themselves will change. Whenever I run my application using the 
> routines the performance is VERY slow. I have not yet added indexes - I do 
> not know
> if that alone will solve the problem. Is there a *better approach* I can use?
> 
> *Any* help is welcomed and appreciated.
> 
> TIA
> 
> P.S. I had heard of a company that sold postgres and thus would also provide
> some support for the product. Does anyone know the name of the company
> and how they can be contacted?
> 
> 
> Casey
> 
> 
> ========================= code starts below ================================
> 
> My routines look something like the following:
> 
> [other code]
> 
> typedef user struct_user {
> char name[20];
> char address[50];
> char city[20];
> char state[10];
> } USER;
> 
> 
> [other code]
> 
> db_add_user_info(USER user_info)
> {
> char* res;
> char tempdata[600];
> 
> sprintf(tempdata, "append user (user.name = \"%s\", user.address=\"%s\", 
> user.city=\"%s\", user.state=\"%s\") ",
>         user_info.name, user_info.address, user_info.city, user_info.state);
> 
> PQsetdb("testdb");
> PQexec("begin");
> 
> res = PQexec(tempdata);
> ^^^
> [ the return values for PQ exec *do not* work! Whenever I made tests using 
> the return code, it was *never* correct ]
> 
> 
> if (*res == 'E')
>         {
>         printf("this did not work 1 \n");
>         PQexec("end");
>         exit();
>         }
> 
> if (*res == 'I')
>         {
>         printf("this did not work 2 \n");
>         PQexec("end");
>         exit();
>         }
> PQexec("end");
> PQfinish();
> 
> [Because the return codes do not work above, I had to add another call to 
> the server to test if the row actually went in]
> 
> }
> 
> 
> One must note the importance of setting reasonable and achievable goals for
>                     "If you aim for nothing, you'll hit it every time" 
>                                -Theodore Roosevelt
> 
> 
> ==============================================================================
>    To add/remove yourself to/from the POSTGRES mailing list: send mail with 
>    the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
>    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
>    a human will deal with it.  DO NOT post to the "postgres" mailing list.
> ==============================================================================
>               URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
> 

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/



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 using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: pcole@ccwf.cc.utexas.edu
  Subject: Re: slow postgres performance
  In-Reply-To: <Pine.LNX.3.91.950827202711.3813B-100000@localhost>

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

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