1
CREATE VIEW bd_nearest_hy AS         
SELECT b1.b_name, h1.h_id
FROM   building b1,hydrant h1 
WHERE  sdo_nn(h1.shape, b1.shape,'sdo_num_res = 1') = 'TRUE';

SELECT  bd_nearest_hy.b_name
FROM    bd_nearest_hy
WHERE   bd_nearest_hy.h_id = 'p30';

我创建了一个视图,用于存储建筑物名称及其对应的最近的消火栓。sdo_nn 语句工作正常,视图正确。

但是,当我从视图中选择包含的行时h_id = p30,数据库会显示:错误报告:

SQL Error: ORA-13249: SDO_NN cannot be evaluated without using index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17 
ORA-06512: at "MDSYS.PRVT_IDX", line 9

它出什么问题了?

4

0 回答 0