Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very poor performance of SIMILAR TO on some arguments + unable to disconnect via DELETE FROM MON$ATTACHMENTS [CORE3858] #4198

Closed
firebird-issue-importer opened this issue May 29, 2012 · 6 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Relate to CORE4810

C:\MIX\firebird\fb25>bin\isql -n -c 2048 localhost/3050:C:\MIX\firebird\fb25\T1.FDB
Database: localhost/3050:C:\MIX\firebird\fb25\T1.FDB
SQL> show version;
ISQL Version: WI-V2.5.2.26482 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-V2.5.2.26482 Firebird 2.5"
Firebird/x86/Windows NT (remote server), version "WI-V2.5.2.26482 Firebird 2.5/tcp (csprog)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.2.26482 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2

SQL> select iif('sdf--asdf_sd.dsfsfh-.sdjskdjfh-_.' SIMILAR TO '(([[:ALNUM:]\_\-])+.?)+([[:ALNUM:]\_\-])+' escape '\', 1, 0) from rdb$database;

-- This query will run about 9 minutes.
Furthermore,
1) it can not be interrupted in another ('monitoring') windows if I issue there: DELETE FROM MON$ATTACHMENTS WHERE ...; COMMIT;
2) CPU is loaded about 100%
3) There is no ability to connect to any database on that machine untill this "strange query" will finish.

Commits: 28e1874

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 22, 2015

Modified by: Sean Leyne (seanleyne)

Link: This issue relate to CORE4810 [ CORE4810 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 27, 2018

Commented by: @pavel-zotov

One more sample.

set list on;
set stat on;

select 1 from rdb$database where
'
group by
MATCODE,
MATNAME,
NOTE,
GROUPCODE,
STATE,
MATPROD,
MATFULL,
KOLVO,
EDIZM,
MATGRPCOD,
CODE,
TEXTTOHIST,
INV_ROOMDOC,
INV_ROOM,
PARENTCODE,
INVIS
'
similar to
'%group[[:WHITESPACE:]]+by[[:WHITESPACE:]]+([[:ALNUM:]]|_)+([[:WHITESPACE:]]*,[[:WHITESPACE:]]*[[:ALNUM:]]+){12,}[[:WHITESPACE:]]*%'
;

NOTE on this part of pattern:
([[:ALNUM:]]|_)+

It is underscore character that is "reason" of very poor performance.
Yes, i understand that escape character should be placed leftside of "_"; but one may to forgot to do this and result will be very bad.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 10, 2019

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2019

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 8, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 8, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants