A lot of OR's are inefficient

General discussion related to "Everything".
Post Reply
therube
Posts: 4967
Joined: Thu Sep 03, 2009 6:48 pm

A lot of OR's are inefficient

Post by therube »

a lot of OR's are inefficient
92, being a "lot", if you will

49130| 49291| 49416| 51033| 51164| 51509| 51511| 51512| 52337| 52626| 52694| 53850| 53899| 53901| 53935| 53936| 53938| 53943| 53944| 53946| 53947| 53949| 54206| 54498| 54500| 54501| 54502| 54503| 54511| 54516| 54655| 54655| 54656| 54867| 54987| 54990| 55034| 55084| 55286| 55336| 55337| 55465| 55468| 55469| 55599| 55676| 57100| 57102| 57104| 57105| 57126| 57143| 57161| 57167| 57169| 57170| 57181| 57183| 57184| 57189| 57196| 57198| 57199| 57202| 57205| 57216| 57217| 57221| 57224| 57225| 57226| 57229| 57231| 57239| 57240| 59085| 95532| 95613| 95706| 96186| 96195| 96199| 96200| 96201| 96209| 96213| 96229| 96303| 96425| 96429| 96432| 96750


original names were like:
> 49130.332.286.256
& i wanted to find matches of the 1st. "word", so "49130"
& i wanted to find
> 49130.332.286.256 & 49130

so i %s/\..*// & %s/$/|/ & Joined the lines
(& pasted that single line in as my search)


not particularly concerned
but i imagine there is a more efficient method ?


if it's not too much trouble...
(& that said, doing what i did is doable, & i can do it, at least with said data set
& the more efficient method i'm likely to not remember ;-))


(heh. & shortly after i came across the 92 lot grouping, i then found a 44 lot grouping.
44 was quicker then 92 ;-).
the 92 happened to be a more fruitful endeavor.)
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: A lot of OR's are inefficient

Post by NotNull »

One way that you likely will remember:
  • Get back to tour original list. Shortened version:

    Code: Select all

    49130
    49291
    49416
    51033
    51164
    51509
    51511
  • 'CTRL + A' , 'CTRL + C' to copy the entire list to the clipboard
  • Paste in Everything's search bar
  • Done!
Long List.png
Long List.png (21.67 KiB) Viewed 4955 times


You can optimize this even further by enclosing the entire search in startwith:<....>:
- type
startwith:<
at the beginning and
>
at the end, giving you:

Code: Select all

startwith:<49130|49291|49416|51033|51164|51509|51511>
therube
Posts: 4967
Joined: Thu Sep 03, 2009 6:48 pm

Re: A lot of OR's are inefficient

Post by therube »

'CTRL + A' , 'CTRL + C' to copy the entire list to the clipboard
Paste in Everything's search bar
Done!
Well, sure. That is just what I did.

Oh, actually I didn't realized that a copy would automatically insert the OR's.
So in that respect I didn't need to "manually" add the OR's, or even Join them.
(So %s/\..*// & copy & done [after Pasting].)


But that's not the issue.
It's simply the sheer number of OR's that ends up being... slow.
ChrisGreaves
Posts: 684
Joined: Wed Jan 05, 2022 9:29 pm

Re: A lot of OR's are inefficient

Post by ChrisGreaves »

therube wrote: Thu Jun 22, 2023 6:26 pma lot of OR's are inefficient; 92, being a "lot", if you will
Hi therube.
This looks like a specific problem - you have a specific subset of strings that matched, will satisfy your objectives.

In a different situation you might consider NOT matching the set of NON-candidates.

If the 92 strings you specified are part of a 100-element set, then you might search for the (100-92)==8 that you DON'T want, and anything else is good.

I suspect that in your case you are looking for 92 values out of a possible 99999 values.
Cheers, Chris
void
Developer
Posts: 16698
Joined: Fri Oct 16, 2009 11:31 pm

Re: A lot of OR's are inefficient

Post by void »

Improving the performance of really long OR lists is on my TODO list.

Wrapping your search with startwith:<...> will be the fastest.



I found number: quite fast:

For example:
number:>=10000

This will significantly reduce the number of results that Everything will need to match with the long OR list.

Please try the following search:

Code: Select all

number:>=10000 49130| 49291| 49416| 51033| 51164| 51509| 51511| 51512| 52337| 52626| 52694| 53850| 53899| 53901| 53935| 53936| 53938| 53943| 53944| 53946| 53947| 53949| 54206| 54498| 54500| 54501| 54502| 54503| 54511| 54516| 54655| 54655| 54656| 54867| 54987| 54990| 55034| 55084| 55286| 55336| 55337| 55465| 55468| 55469| 55599| 55676| 57100| 57102| 57104| 57105| 57126| 57143| 57161| 57167| 57169| 57170| 57181| 57183| 57184| 57189| 57196| 57198| 57199| 57202| 57205| 57216| 57217| 57221| 57224| 57225| 57226| 57229| 57231| 57239| 57240| 59085| 95532| 95613| 95706| 96186| 96195| 96199| 96200| 96201| 96209| 96213| 96229| 96303| 96425| 96429| 96432| 96750
Post Reply