title: What's the proper way to do a spatial join in Oracle?
body: <p>Oracle has a table function called <a href="https://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_operat.htm#SPATL1032" rel="nofollow noreferrer">SDO_JOIN</a> that is used to do join tables based on spatial relations. An example query to find what neighbourhood a house is in is something like this:</p>
  
  <pre><code>select 
      house.address,
      neighbourhood.name
  from table(sdo_join('HOUSE', 'GEOMETRY', 'NEIGHBOURHOOD', 'GEOMETRY', 'mask=INSIDE')) a 
  inner join house
      on a.rowid1 = house.rowid
  inner join neighbourhood
      on a.rowid2 = neighbourhood.rowid;
  </code></pre>
  
  <p>But I get the same result by just doing a regular join with a spatial relation in the on clause:</p>
  
  <pre><code>select 
      house.address,
      neighbourhood.name
  from house
  inner join neighbourhood
      on sdo_inside(house.geometry, neighbourhood.geometry) = 'TRUE';
  </code></pre>
  
  <p>I prefer the second method because I think it's easier to understand what exactly is happening, but I wasn't able to find any Oracle documentation on whether or not this is the proper way to do a spatial join. </p>
  
  <p>Is there any difference between these two methods? If there is, what? If there isn't, which style is more common?</p>