in reply to Faster of two options for finding keywords in a database
Using a regex here is not a wise decision, even with proper delimiters (which are dangerously lacking).
If destructing¹ the hash is fine I'd try delete @kws{@kwlist} (see delete and hash slice) and calculate the difference of scalar keys %kws before and after.
But - as you already mentioned- I suppose PG has already a built-in hash slice feature you could use for faster execution.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
FWIW your use of defined is also error prone, exists it's the way to go.
¹) and if destructing is not ok consider delete local @kws{@kwlist} , DISCLAIMER I've never used it, wasn't even actively aware of it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Faster of two options for finding keywords in a database
by cormanaz (Deacon) on Feb 19, 2024 at 18:20 UTC | |
by LanX (Saint) on Feb 20, 2024 at 00:05 UTC |