Re[7]: SQL поиск как в google
От: Аноним  
Дата: 23.11.09 21:37
Оценка:
ну возьми более приличный оракл ...

SQL> create table words (word varchar2(50)) ;

Table created.

SQL> insert into words values ('Just');

1 row created.

SQL> insert into words values ('arms');

1 row created.

SQL> insert into words values ('curvature');

1 row created.

SQL> insert into words values ('radius');

1 row created.

SQL> insert into words values ('man');

1 row created.

SQL> commit ;

Commit complete.

SQL> create index soundex_idx on words (soundex(word)) ;

Index created.

SQL> set autotrace on ;
SQL> select * from words where soundex(word)=soundex('men') ;

WORD
--------------------------------------------------
man


Execution Plan
----------------------------------------------------------
Plan hash value: 973613626

-------------------------------------------------------------------------------------------

| Id  | Operation                   | Name        | Rows  | Bytes | Cost (%CPU)| Time     |

-------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT            |             |     1 |    27 |     2   (0)| 00:00:01 |

|   1 |  TABLE ACCESS BY INDEX ROWID| WORDS       |     1 |    27 |     2   (0)| 00:00:01 |

|*  2 |   INDEX RANGE SCAN          | SOUNDEX_IDX |     1 |       |     1   (0)| 00:00:01 |

-------------------------------------------------------------------------------------------
soundex
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.