pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Spiegelberg <gspiegelberg@cranel.com>
To: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Optimization questions
Date: Wed, 28 Jan 2004 14:49:41 -0500
Message-ID: <40181255.40606@cranel.com> (raw)

Couple quick questions.

1. Turning autocommit=FALSE is most useful when using COPY to load
    data to a table and could impact the performance of INSERT of
    similiar data on the same table.

2. What comparison operator is the most efficient when comparing
    text or varchar?  Today the SELECT I use to compare rows in this
    table do a simple row comparison

     (A.c1,A.c2,A.c3,...)<>(B.c1,B.c2,B.c3,...)

    but there is a mix of int8, varchar, text in there.  Just fishing
    to see if I should instead use

     ((A.i1,A.i2,A.i3)<>(B.i1,B.i2,B.i3)AND A.t1!=B.t1)

    or

     ((A.i1,A.i2,A.i3)<>(B.i1,B.i2,B.i3)AND compare_func(A.t1,B.t1))

    where columns iX are integer and tX are text or varchar.

While I'm asking, how is TEXT and VARCHAR compared?  Byte by Byte until
there's an inequality?

Just checking.

Ty,
Greg

-- 
Greg Spiegelberg
  Sr. Product Development Engineer
  Cranel, Incorporated.
  Phone: 614.318.4314
  Fax:   614.431.8388
  Email: gspiegelberg@Cranel.com
Cranel. Technology. Integrity. Focus.





Message-ID: <40181255.40606@cranel.com>
Permalink:  ../40181255.40606@cranel.com/
Also on:    postgresql.org/message-id/40181255.40606@cranel.com

 · 

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: pgsql-performance@postgresql.org
  Cc: gspiegelberg@cranel.com
  Subject: Re: Optimization questions
  In-Reply-To: <40181255.40606@cranel.com>

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

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