[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File search progress: database review and question on triggers
From: |
Pierre Neidhardt |
Subject: |
Re: File search progress: database review and question on triggers |
Date: |
Thu, 13 Aug 2020 08:58:16 +0200 |
Hi Arun,
Arun Isaac <arunisaac@systemreboot.net> writes:
> sqlite insert statements can be very fast. sqlite.org claims 50000 or
> more insert statements per second. But in order to achieve that speed
> all insert statements have to be grouped together in a single
> transaction. See https://www.sqlite.org/faq.html#q19
Very good point, thanks a lot! I'll try again!
>> A string-contains filter takes less than 1 second.
>
> Guile's string-contains function uses a naive O(nk) implementation,
> where 'n' is the length of string s1 and 'k' is the length of string
> s2. If it was implemented using the Knuth-Morris-Pratt algorithm, it
> could cost only O(n+k). So, there is some scope for improvement here. In
> fact, a comment on line 2007 of libguile/srfi-13.c in the guile source
> tree makes this very point.
Thanks for this low-level insight, this is very useful!
Then if we can get Knuth-Morris-Pratt in the next Guile version, a
textual database could be an ideal option in terms of performance.
>> I need to measure the time SQL takes for a regexp match.
>
> sqlite, by default, does not come with regexp support. You might have to
> load some external library. See
> https://www.sqlite.org/lang_expr.html#the_like_glob_regexp_and_match_operators
>
> --8<---------------cut here---------------start------------->8---
> The REGEXP operator is a special syntax for the regexp() user
> function. No regexp() user function is defined by default and so use of
> the REGEXP operator will normally result in an error message. If an
> application-defined SQL function named "regexp" is added at run-time,
> then the "X REGEXP Y" operator will be implemented as a call to
> "regexp(Y,X)".
> --8<---------------cut here---------------end--------------->8---
I saw that. Now I need to how regexp search performs as opposed to
pattern search.
Cheers!
--
Pierre Neidhardt
https://ambrevar.xyz/
signature.asc
Description: PGP signature
- Re: File search progress: database review and question on triggers, (continued)
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Ricardo Wurmus, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Hartmut Goebel, 2020/08/15
- Re: File search progress: database review and question on triggers, Bengt Richter, 2020/08/15
- Re: File search progress: database review and question on triggers, Hartmut Goebel, 2020/08/16
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/12
- Re: File search progress: database review and question on triggers, Arun Isaac, 2020/08/12
- Re: File search progress: database review and question on triggers,
Pierre Neidhardt <=
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Ricardo Wurmus, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Arun Isaac, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Arun Isaac, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Pierre Neidhardt, 2020/08/13
- Re: File search progress: database review and question on triggers, Arun Isaac, 2020/08/15