Re: indices - used by which user ? - Mailing list pgsql-general

From
Subject Re: indices - used by which user ?
Date
Msg-id 14541.213.33.72.146.1052382848.squirrel@webmail.inode.at
Whole thread Raw
In response to Re: indices - used by which user ?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
After investigating further, I found out, that the index will also be not
used if I do a psql -U postgres <database>, unless I issue a \c command,
in fact even \c - does it.

The other thing I found out: the joined colums are of type character
varying(10) and text, in this case the index (of the table having the text
column) will be used (after the \c trick), I have similiar other
databases, where both joined columns have the same type (character
varying(10)) and the index is never ever used, which does'nt make sense to
me.
Don't ask me wy the types are different, might be due to a dump/reload
during several upgrades.
Fact is, that the runtime of the query in the other (those having equal
types) databases  is about as fast as in the one with different types when
using indices.
But why does joining columns with different types use indices, whereas
equal type joins do not use indices.


Gerhard


pgsql-general by date:

Previous
From:
Date:
Subject: Re: indices - used by which user ?
Next
From: Manfred Koizar
Date:
Subject: Re: indices - used by which user ?