Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^7: Documentation of REGEXP support in DBD::SQLite?

by LanX (Saint)
on Nov 16, 2024 at 07:52 UTC ( [id://11162750]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Documentation of REGEXP support in DBD::SQLite?
in thread Documentation of REGEXP support in DBD::SQLite?

Thanks :)

> Because, of course, if there are too many hits (here: 897633), the system switches to SeqScan

This doesn't decisively answer the question if trigrams are indexed by bigrams... 🤔

What if you search a bigram which is - by design- only in few rows?

Or an and combination of multiple bigrams?

And to be sure, please use the like '%ab%' form again.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^8: Documentation of REGEXP support in DBD::SQLite?
by erix (Prior) on Nov 16, 2024 at 08:31 UTC

    (For decisive answers, read the postgres code ;))

    And to be sure, please use like '%ab%' again.

    I can't get bigrams to respond quickly; also not when there is only one matching value; with this data it will always Seq scan (sometimes with parallel workers: just under 1 second).

    In postgres, 'LIKE' doesn't allow regex (although its simple pattern search can sometimes use the trigram or btree index). Postgres uses the tilde for regex search (~ case sensitive, ~* case insensitive).

      > I can't get bigrams to respond quickly

      Hence they are not indexed.

      > although its simple pattern search can sometimes use the trigram or btree index

      That's why I wanted LIKE, to be sure the trigram optimization can be chosen

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11162750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2026-05-09 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.