Re: select ... where ='' does a seqscan [auf Viren - Mailing list pgsql-general

From Tom Lane
Subject Re: select ... where ='' does a seqscan [auf Viren
Date
Msg-id 5046.1093366376@sss.pgh.pa.us
Whole thread Raw
In response to Re: select ... where ='' does a seqscan [auf Viren  (Silvio Matthes <silvio.matthes@xcom.de>)
Responses Re: select ... where ='' does a seqscan [auf  (Silvio Matthes <silvio.matthes@xcom.de>)
List pgsql-general
Silvio Matthes <silvio.matthes@xcom.de> writes:
> But in my opinion with the multicolumn index in mind the server should do
> a index scan, because there are only 7 rows with param_name='KUNDEN_NR'
> and param_value=''?!?

We do not have any cross-column statistics at the moment, so the planner
is unable to recognize the potential win here.  Note the poor estimate
of the number of matching rows in your EXPLAIN result.

I think though that it might help to put param_name first in the
multicolumn index.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_stat_activity versus ps
Next
From: Tom Lane
Date:
Subject: Re: WG: Re: Re: select ... where ='' does a seqscan [auf Viren geprueft]