Skip site navigation (1) Skip section navigation (2)

Re: [PERFORM] How to force an Index ?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Rhaoni Chiu Pereira <rhaoni(at)sistemica(dot)info>
Cc: PostgreSQL ADMIN <pgsql-admin(at)postgresql(dot)org>,PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORM] How to force an Index ?
Date: 2003-09-18 17:50:34
Message-ID: 200309181050.34270.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-performance
Rhaoni,

>  ... gsames00.ano_mes = to_char(ftnfco00.data_emissao,'YYYYMM') AND ...

>    Then it uses the gsames00 index instead of a SeqScan 'cuz it is
> camparing same data type, but .. I don't want to create this function 'cuz
> this aplication is used with Oracle too.

You should have said that earlier ....

> I need to know if there is a way to set the to_char output to varchar
> instead of text !

Did you try: 

... gsames00.ano_mes = (to_char(ftnfco00.data_emissao,'YYYYMM')::VARCHAR) AND 
...


-- 
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2003-09-18 17:53:57
Subject: Re: Find one record
Previous:From: Josh BerkusDate: 2003-09-18 17:34:13
Subject: Re: rewrite in to exists?

pgsql-admin by date

Next:From: Josh BerkusDate: 2003-09-18 18:02:10
Subject: Re: How to force an Index ?
Previous:From: Chris White (cjwhite)Date: 2003-09-18 17:01:28
Subject: Re: Testing for a record before update or insert without using a function.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group