<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Calc autofilter freeze after deselecting an item and pressing OK (number 2)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=133835#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Calc autofilter freeze after deselecting an item and pressing OK (number 2)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=133835">bug 133835</a>
from <span class="vcard"><a class="email" href="mailto:suokunlong@126.com" title="Kevin Suo <suokunlong@126.com>"> <span class="fn">Kevin Suo</span></a>
</span></b>
<pre>I reported <a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - AutoFilter Improvement: Use "Not Equal" (i.e., <>) when we selected all but one item"
href="show_bug.cgi?id=136838">bug 136838</a> before I found this one. Seems a duplicate. I am copy the
following from that bug:
Assume a column contains n items. When we open the autofilter and un-selected
one, then we have n-1 items selected. Doing this filter with AutoFilter is slow
because it seems to be using the "x in n-1" logic. However, doing this filter
with Standard Filter is fast if we use "Not Equal" logic.
Steps to Reproduce:
1. Open the <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=165612" name="attach_165612" title="test ODS file with autofilter">attachment 165612</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=165612&action=edit" title="test ODS file with autofilter">[details]</a></span>.
2. Click the autofilter in column A, and de-select the 1st item (i.e., #N/A),
then click OK.
--> Slow, it takes more than 8s.
3. Use Standard Filter, and set condition "POMatch <> #N/A", then click OK.
--> Fast, it takes 1s.
Apparently, if we deselect only one item, the condition is the same as <> that
item. It should be more expensive to compare the value to see whether it is in
the n-1 list.
Actually, if we de-select several items (e.g., 3 items), it would still be
faster to use "(x <> a) and (x <> b) and (x <> c)". However, if the deselected
items are quite a lot, the "x in n-1" logic should be faster.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>