Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA03998; Mon, 28 Jun 93 19:42:14 -0700
Message-Id: <9306290242.AA03998@postgres.Berkeley.EDU>
From: Mike Olson <mao@postgres.Berkeley.EDU>
Subject: Re: Access Methods
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: bunting@pangaea.dme.nt.gov.au's message of 28 Jun 1993 16:22 PDT
Date: Mon, 28 Jun 1993 16:35:42 -0700
From: Mike Olson <mao@postgres.Berkeley.EDU>

bunting@pangaea.dme.nt.gov.au (Chris Bunting 61-89-895442) writes:

> define index obj_bbox on OBJECT using rtree (bbox box_ops)
> define index obj_mtype on OBJECT using btree (m_type int4_ops)
> 
> the idea being to store the bounding box of spatial data of different types
> hence the m_type.
> 
> The query optimiser seems to always give the rtree index a higher priority
> than the btree and I want it to have the opposite behaviour.
> 
> Does anyone have any suggestions.

if you do

	replace pg_class (relpages = 10000, reltuples = 100000)
		where pg_class.relname = "obj_bbox"

you'll make the rtree less attractive, since the planner will assume
that it'll have to do much more i/o to use the rtree than the btree.
the down side is that you make the rtree less attractive than sequential
scans, as well.  you can adjust the constants up or down to see what
works for you.
					mike
