[postgis-devel] RE: join selectivity

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Mon Dec 13 02:16:09 PST 2004


> -----Original Message-----
> From: strk [mailto:strk at keybit.net] 
> Sent: 10 December 2004 15:35
> To: Mark Cave-Ayland
> Cc: postgis-devel at postgis.refractions.net
> Subject: join selectivity
> 
> 
> Taking a look at join selectivity...
> For a query like this:
> 
> 	SELECT id FROM table1, table2 
> 	WHERE table1.geom && table2.geom;
> 
> RESTRICT selectivity is invoked twice and
> JOIN selectivity is invoked once.
> The RESTRICT code is not able to find a costant part
> and thus returns the default value (0.000005),
> JOIN selectivity so far returns an hard-wired 0.1.
> 
> Questions:
> (1) What should RESTRICT selectivity do in this case ?!
> (2) Is JOIN selectivity a fraction of table2 X table1
>     records ?


Hi strk,

Really??! I can't see why the RESTRICT selectivity should be called - the
only thing I can think of is that it's being called as some part of cast or
query rewriting.

Hmmm good question - the wording in the documentation is "The idea behind a
join selectivity estimator is to guess what fraction of the rows in a pair
of tables will satisfy a WHERE-clause condition of the form" which is
slightly ambiguous - I would ask on pgsql-hackers now that the mailing lists
are working normally again.


Kind regards,

Mark.

------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT 

T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk





More information about the postgis-devel mailing list