SQL Server – Do filtered indexed views cause conflicts in the underlying table if rows are added to the table that are outside the filter?

If I create an indexed view on a spreadsheet and the query for that spreadsheet contains a filter, new records are added to the spreadsheet that do not fall into that filter (and therefore are not displayed in the indexed view), adding additional competition from the indexed view the table while these records are added to it?

Example:

CREATE VIEW FilteredIndexedView WITH SCHEMABINDING AS

SELECT TextColumn1, TextColumn2
FROM dbo.BoringTable
WHERE DateColumn1 < '1/1/2019';

CREATE CLUSTERED INDEX IX_FilteredIndexView_DateColumn1 ON FilteredIndexView (DateColumn1);

INSERT INTO dbo.BoringTable (TextColumn1, TextColumn2, DateColumn1)
SELECT 'SomeText', 'SomeOtherText', '12/11/2019'; -- Some date that falls outside the filter of the indexed view

iptables – Ports were filtered, but why?

My Raspbian Rpi4 for some reason started filtering external access to ports, as you can see here:

(hendry@t480s ~)$ sudo nmap 192.168.1.4
Starting Nmap 7.80 ( https://nmap.org ) at 2019-11-10 08:35 +08
Nmap scan report for 192.168.1.4
Host is up (0.0027s latency).
Not shown: 994 closed ports
PORT     STATE    SERVICE
22/tcp   open     ssh
53/tcp   open     domain
80/tcp   filtered http
443/tcp  filtered https
8080/tcp filtered http-proxy
9000/tcp filtered cslistener
MAC Address: DC:A6:32:0E:A7:25 (Raspberry Pi Trading)

I have restarted the device and the problem is resolved:

Nmap done: 1 IP address (1 host up) scanned in 1.57 seconds
(hendry@t480s ~)$ sudo nmap 192.168.1.4
Starting Nmap 7.80 ( https://nmap.org ) at 2019-11-10 08:39 +08
Nmap scan report for 192.168.1.4
Host is up (0.0016s latency).
Not shown: 994 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
53/tcp   open  domain
80/tcp   open  http
443/tcp  open  https
8080/tcp open  http-proxy
9000/tcp open  cslistener
MAC Address: DC:A6:32:0E:A7:25 (Raspberry Pi Trading)

Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds

I did not knowingly change the iptables. Any ideas why that could have happened ?!

api – In Magento SOAP can not be filtered by created_at field

Title says it all. The API does not appear to filter for the created_at value of the product. I can filter for any other value, especially after updated_at, but not after created_at. I've found that the created_at value of the particular product appears to be abnormal. Here's what catalogProductInfo queried by product_id returns:

...
2012-02-01T14:30:55-05:00
2019-01-17 10:09:49
...

"Updated_at" seems to have a normal date, but "created_by" is incorrect, or I may not understand this format. If I try and filter with catalogProductList, an empty result is returned:


    {{session}}
    
        
             
                created_at
                2012-02-01T14:30:55-05:00
             
        
    

Can someone help me understand why this does not work?

filter – saving the filtered view does not work

I've created a list of article titles with column headings imported from a spreadsheet created in Excel. I notice that when sorting (ascending / descending, etc.) in the column the message "This column type can not be sorted" is displayed. Why is this happening on my list?
NOTE: I have adjusted each column. Some are multi-choice columns, some are single lines of text, others are dates.

Another problem is that I want to create views that I want to share with the various program offices that submit files at a specific due date. With Sharepoint I was able to save some files after they were sorted (see screenshot), but others did not (see screenshots). I tried to save the view in both Chrome and Explorer. What's happening?

Enter image description here

SQL Server – The filtered index is not used if the WHERE condition contains a variable

Why does MS SQL Server reject the use of the supported filtered index in this scenario?

-- demo data
CREATE TABLE #Test (
    ID INT IDENTITY(1,1) NOT NULL CONSTRAINT PK_Test_ID PRIMARY KEY
    ,Col1 NVARCHAR(36) NOT NULL DEFAULT NEWID()
    ,Col2 NVARCHAR(20) NOT NULL DEFAULT N''  -- !!
    );

WITH
    L0   AS(SELECT 1 AS C UNION ALL SELECT 1 AS O), -- 2 rows
    L1   AS(SELECT 1 AS C FROM L0 AS A CROSS JOIN L0 AS B), -- 4 rows
    L2   AS(SELECT 1 AS C FROM L1 AS A CROSS JOIN L1 AS B), -- 16 rows
    L3   AS(SELECT 1 AS C FROM L2 AS A CROSS JOIN L2 AS B), -- 256 rows
    L4   AS(SELECT 1 AS C FROM L3 AS A CROSS JOIN L3 AS B), -- 65,536 rows
    L5   AS(SELECT 1 AS C FROM L4 AS A CROSS JOIN L4 AS B), -- 4,294,967,296 rows
    Nums AS(SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS N FROM L5)
INSERT INTO #Test(Col2)
SELECT TOP 100000 N''
FROM Nums;

INSERT INTO #Test(Col2)
VALUES(N'ABC');

-- FILTERED index to support filter predicate of a query
CREATE NONCLUSTERED INDEX IX_Test_Col2_filtered ON #Test (Col2 ASC) WHERE Col2 <> N'';

-- just checking statistics
DBCC SHOW_STATISTICS('#Test', 'IX_Test_Col2_filtered')

-- condition on variable = index scan :-(
DECLARE @Filter NVARCHAR(20) = N'ABC'

SELECT Col1
FROM #Test
WHERE Col2 = @Filter
    AND Col2 <> N'';

Enter image description here

When using literals everything goes as expected.

-- condition on literal value - index seek + key lookup :-)
SELECT Col1
FROM #Test
WHERE Col2 = N'ABC';

Enter image description here

filters – Show Filtered Profile by Role

I'm changing a WordPress theme that includes a filter page with user profiles.
The entire filter mechanism seems to be based on snails.

I want to add a filter by role, but roles have no slug.

add_action( 'register_form', 'role_register_form' );
function list_role() {

    global $wp_roles;
    echo '';
}

The ad is fine, but the filter does not work because the reels have no slugs.

Here is the javascript code of the filter mechanism

// filter skill
                if (view.getUrlParameter('role_profile')) {
                    setTimeout(function () {
                        $('list_all_roles li a(name="' + view.getUrlParameter('role_profile') + '")').click();
                        $('body').click();
                    }, 1000);
                }
                $('.list_all_roles').on('click', function (event) {
                    var $target = $(event.currentTarget),
                        name = $target.attr('data-name'),
                        selected = $target.find('li a.active');
                    if (name !== 'undefined') {
                        role = _.map(selected, function (element) {
                            //return $(element).html(); 1.8.4
                            return $(element).attr('name'); // 1.8.6 filter in prfiles page.
                        });
                        view.query(name) = role;
                        view.page = 1;
                        view.fetch($target);
                    }
                });

and here the function getUrlParameter:

        getUrlParameter: function (name) {
            var results = new RegExp('(?&)' + name + '=((^&#)*)').exec(window.location.href);
            if (results == null) {
                return null;
            }
            else {
                return results(1) || 0;
            }
        }

Edit an item in a filtered list that falls out of the filter

  • I have a list of items (such as tasks).
  • I filter her for a property like her name.
  • In the filtered list I opted for inline editing (at the touch of a button)
  • The new name is outside the above filter

What should I do?

  1. Leave the element with the new name and a name that does not match the filter criteria. Give it up only if I change the filter criteria.
  2. Immediately put it off the list.

I am looking for guidance on best practices and common examples.

Many thanks.

User expectation – How can a constantly changing data list be sorted and filtered?

I have a web page (although I do not think that's relevant, it can also be a desktop or mobile app) that displays a list of events. More and more events arrive and are added to the top of the list as they arrive. We'd like to sort and filter this list, but I'm not sure what to do with incoming events if the list is sorted or filtered by something other than the latest.

For example, if the user filters the list by event type "Jim" and a new event of type "Fred" arrives, it probably will not be displayed. The only thing is that they may keep the list filtered and then not see most incoming events. This will probably confuse you.

Likewise, if you sort the list by (about) duration, shorter first, and a new event with a duration longer than the one shown, do I add it to the list? If so, does it have to be inserted in the right place in the list?

To update In response to the outstanding questions from TripeHound, here's a bit more detail: users will be watching the site during a campaign and their main interest is to see new events. You may be filtering for events that have triggered specific users, sorting for events that have triggered the most or the shortest events, and so on. In short, it's very important for you to see new events.

Who can guess. Many Thanks

Are filtered emails automatically redirected to Gmail?

Let's say I've turned on automatic forwarding from my Gmail account (Account 1) to another Gmail account (Account 2) so that all emails sent to Account 1 are automatically routed to Account 2.

When I create a filter in account 1, some incoming emails are moved to the trash. Will these emails continue to be forwarded to account 2? What happens if this filter is set to archive certain emails – will they be forwarded to account 2?