Home > database >  Oracle similarity query, particularly slow, how to improve the speed?
Oracle similarity query, particularly slow, how to improve the speed?

Time:01-02

The SELECT a.s bya02_id aa, b.s bya02_id bb
FROM a
Left the join ASBY_SBYA02 b on b.s bya02_id=3282
WHERE rownum<2
And a.s bya02_id & lt;> 3282
And (SYS. UTL_MATCH. EDIT_DISTANCE_SIMILARITY (a.C 04, the biggest 04) & gt;=40
The or SYS. UTL_MATCH. EDIT_DISTANCE_SIMILARITY (a.C 02, biggest 02) & gt;=40
The or SYS. UTL_MATCH. EDIT_DISTANCE_SIMILARITY (a.C 03, biggest 03) & gt;=40
The or SYS. UTL_MATCH. EDIT_DISTANCE_SIMILARITY (a.C 05, the biggest 05) & gt;=40
The or SYS. UTL_MATCH. EDIT_DISTANCE_SIMILARITY (a.C 06, biggest 06) & gt;=40
)

Our fleet, c03, c04, c05 c06 fields are about 2000 words,
Now, if A table is 1000 lines of data, query time is 4 minutes,

Now, if A table is 20000 lines of data, query time is 85 minutes,

Now want to ask, how to improve the speed, by using the method of hardware or software?

CodePudding user response:

Haven't associated conditions b a table, you want to quickly to what degree

CodePudding user response:

A table B is no associated conditions, but ON b.s bya02_id=3282 this list, sbya02_id is A primary key, all it is A record,

Actually now this association is not the main problem, the problem is a string in a table to find the similarity in the record of 40 speed speed problem,

These days has been tried, now think of multi-thread method, but multiple threads appear to have multiple databases to operate, do not know to have a great god had a similar experience?

CodePudding user response:

Is a big probability similarity algorithm is slow, first determine whether the problem,

The create table aaaa as SELECT *
FROM a
Left the join ASBY_SBYA02 b on b.s bya02_id=3282
WHERE rownum<2
And a.s bya02_id & lt;> 3282

To perform all the similarity calculation full table directly, if is slow, can only add threads or changed algorithm

CodePudding user response:

Has to perform all the similarity calculation, a full table is slow, this slow is not slow, other is each record, about 1 to 2 s, slowly add up to the
Then there is no way to use the method of thread, but don't know you there is a good way to great god, or a good thread method, is my way to

For I=0 to the number of threads do
{
SELECT *
FROM a
Left the join ASBY_SBYA02 b on b.s bya02_id=3282
WHERE rownum<2
And a.s bya02_id & lt;> 3282
And a record id=

}

CodePudding user response:

Edit distance similarity algorithm complexity is O (m * n), m is the length of the string first, n is the length of the string, the second if it is 2, 2000, the length of the light is called a 4 million computational overhead,
This program can only be made faster, with the database is not so fast,

CodePudding user response:

No simultaneous between two tables, the query table to heavy, two tables of at least one simultaneous conditions, can be oh, I may not understand what you want that kind of query results

CodePudding user response:

reference 6 building berth at night on the bridge response:
no simultaneous between two tables, the query table to heavy, two tables of at least one simultaneous conditions, can be oh, I could not understand what you want that kind of query results


In fact this is the removal of a data in a table, then to compare the all the data and data check process
Such as a table with 1000 records, it is 1, records, and other 999 records than as a result,
I now is to use multithreading, 999 records can be divided into multiple threads, and at the same time the article 1 record
  • Related