Re: Queries joining views

From: DelGurth <delgurth(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Cc: alban(at)magproductions(dot)nl
Subject: Re: Queries joining views
Date: 2006-08-21 22:23:36
Message-ID: 10268b3e0608211523x24cb472er737af03657785113@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 8/21/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Hmph ... it certainly appears to be choosing the wrong index in the
> second case. I wonder why --- can you show the relpages and reltuples
> stats from pg_class for these indexes?

I'm personally not aware how to do that, perhaps Alban will (tell me how to)
do that tomorrow.

It might be interesting also to examine the output of just
>
> explain select * from mm_insrel_table where dnumber=558332 and dir<>1
>
> with different subsets of these indexes in place. I'd like to see what
> it's deriving as the cost estimates for these indexes. If you can get
> an EXPLAIN selecting each one of the indexes, that would help diagnose
> what's going on.

Ok. Did that (with your trick, thanks!). The output is attached to
this e-mail. The script I used to drop the indexes dropped them in the
order it was using them
(partially by accident, partially because I assumed it would work in that
order).

I'm not sure if you want to see more permutations, if so please tell me.

BTW, what PG version is this exactly?

Our PG version is the version downloadable from
http://www.sunfreeware.com/programlistsparc10.html#postgresql, so 8.0.1 for
solaris sparc.

(it's a sun T2000 test machine).

regards, tom lane
>

Regards,
Wessel van Norel

Attachment Content-Type Size
index_differences.txt text/plain 3.3 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DelGurth 2006-08-21 22:37:55 Re: Queries joining views
Previous Message Jeff Davis 2006-08-21 22:23:14 Standby system script

Browse pgsql-hackers by date

  From Date Subject
Next Message DelGurth 2006-08-21 22:37:55 Re: Queries joining views
Previous Message Jim Nasby 2006-08-21 22:11:44 Re: pgstattuple extension for indexes