Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)

Поиск
Список
Период
Сортировка
От Davide Jensen
Тема Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)
Дата
Msg-id CAM+X8W-rz4z4VLGfDe0zeMeRxBkrpdcKRZYNzsjjR3TtcLjNwA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Different result behavior when using ANY(ARRAY(SELECT)) and IN (SELECT)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi everyone,
I'm encountering some problems in understanding the behavior of a query that uses an IN operator, the query i'm executing is the following:

SELECT * FROM   (
              SELECT _id,
                     ROW_NUMBER() OVER () AS _rownumber
              FROM   (
                              SELECT   "Id"                _id,
                                       "IdClass"::regclass _idclass,
                                       "CurrentId"         _currentid,
                                       "User"              _user,
                                       "BeginDate"         _begindate,
                                       "EndDate"           _enddate,
                                       "Status"            _status,
                                       "Code"              _code,
                                       "Description"       _description
                              FROM     "Hardware" _hardware
                              WHERE    "IdClass" = ANY (ARRAY[...])
                              AND      "Id" IN (
                                       (
                                              SELECT "Id"
                                              FROM   "Hardware"
                                              WHERE  "Status" = 'A'
                                              AND    "IdClass" NOT IN ('"NetEquipment"'::regclass,
                                                                       '"Battery"'::regclass,
                                                                       '"DistribBoard"'::regclass,
                                                                       '"Termination"'::regclass,
                                                                       '"SysEquipment"'::regclass) ))
                              AND      "IdClass" = ANY (ARRAY[...])
                              AND      "Status" = 'A'
                              ORDER BY _code ASC) _rdinner) _rdouther
WHERE  _id = 64297639;

I've excluded the content of the arrays because it would have been too much useless text;
When executing this query i'm expecting a single result with the row number of the record and its Id but instead i'm obtaining different results at every execution, here the results of 3 sequential executions:
* 1) 64297639;2490
       64297639;20867
* 2) 64297639;2484
       64297639;14683
* 3) 64297639;2511
       64297639;20844
After researching a bit on the internet I've found people that were encountering some issues with the usage of the IN operator and solved the problem by switching it to an ANY(ARRAY()), so i've changed the following part of the query:
AND      "Id" IN (
                                       (
                                              SELECT "Id"
                                              FROM   "Hardware"
                                              WHERE  "Status" = 'A'
                                              AND    "IdClass" NOT IN ('"NetEquipment"'::regclass,
                                                                       '"Battery"'::regclass,
                                                                       '"DistribBoard"'::regclass,
                                                                       '"Termination"'::regclass,
                                                                       '"SysEquipment"'::regclass) ))

to this one:

AND      "Id" = ANY ( ARRAY (
                                              SELECT "Id"
                                              FROM   "Hardware"
                                              WHERE  "Status" = 'A'
                                              AND    "IdClass" NOT IN ('"NetEquipment"'::regclass,
                                                                       '"Battery"'::regclass,
                                                                       '"DistribBoard"'::regclass,
                                                                       '"Termination"'::regclass,
                                                                       '"SysEquipment"'::regclass) ))
In this case the result of the whole query is what i'm expecting and it's consistent at every execution:
64297639;2211
To try and understand the difference between the two queries i've tried using the EXPLAIN ANALYZE and this is the result:

* Query with IN operator:

"Subquery Scan on _rdouther  (cost=9285.49..11035.69 rows=1 width=16) (actual time=26.841..41.850 rows=2 loops=1)"
"  Filter: (_rdouther._id = 64297639)"
"  Rows Removed by Filter: 27138"
"  ->  WindowAgg  (cost=9285.49..10889.84 rows=11668 width=16) (actual time=25.156..40.675 rows=27140 loops=1)"
"        ->  Subquery Scan on _rdinner  (cost=9285.49..10743.99 rows=11668 width=8) (actual time=25.153..34.801 rows=27140 loops=1)"
"              ->  Gather Merge  (cost=9285.49..10627.31 rows=11668 width=815) (actual time=25.152..32.900 rows=27140 loops=1)"
"                    Workers Planned: 1"
"                    Workers Launched: 1"
"                    ->  Sort  (cost=8285.48..8314.65 rows=11668 width=815) (actual time=18.988..19.671 rows=13570 loops=2)"
"                          Sort Key: _hardware."Code""
"                          Sort Method: quicksort  Memory: 1717kB"
"                          ->  Hash Semi Join  (cost=1408.19..3307.79 rows=11668 width=815) (actual time=8.489..15.665 rows=13570 loops=2)"
"                                Hash Cond: (_hardware."Id" = "Hardware"."Id")"
"                                ->  Append  (cost=0.00..1739.09 rows=11673 width=45) (actual time=0.009..4.489 rows=13570 loops=2)"
"                                      ->  Parallel Seq Scan on "Hardware" _hardware  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "ServerHW" _hardware_1  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "ClientHW" _hardware_2  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "PhoneHW" _hardware_3  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Peripheral" _hardware_4  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "RackDevice" _hardware_5  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "BladeChassis" _hardware_6  (cost=0.00..1.72 rows=5 width=29) (actual time=0.003..0.006 rows=4 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                            Rows Removed by Filter: 4"
"                                      ->  Parallel Seq Scan on "NetworkDevice" _hardware_7  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Server" _hardware_8  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Storage" _hardware_9  (cost=0.00..6.36 rows=44 width=28) (actual time=0.006..0.022 rows=38 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "System" _hardware_10  (cost=0.00..51.42 rows=386 width=226) (actual time=0.001..0.131 rows=328 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Computer" _hardware_11  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "DesktopDevice" _hardware_12  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "MobileDevice" _hardware_13  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "TelephoneExchange" _hardware_14  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "VideoconfSys" _hardware_15  (cost=0.00..4.24 rows=28 width=22) (actual time=0.001..0.012 rows=24 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                            Rows Removed by Filter: 1"
"                                      ->  Parallel Seq Scan on "Modem" _hardware_16  (cost=0.00..2.26 rows=16 width=34) (actual time=0.001..0.007 rows=14 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Monitor" _hardware_17  (cost=0.00..1.13 rows=2 width=25) (actual time=0.001..0.002 rows=2 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Printer" _hardware_18  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "GenericRackDevice" _hardware_19  (cost=0.00..119.69 rows=920 width=36) (actual time=0.001..0.245 rows=782 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                            Rows Removed by Filter: 6"
"                                      ->  Parallel Index Scan using "_cm3_GenNetDevice_IdClass" on "GenNetDevice" _hardware_20  (cost=0.29..1107.31 rows=8209 width=34) (actual time=0.026..2.134 rows=10638 loops=2)"
"                                            Index Cond: ((("IdClass")::oid = ANY ('{96465301,96465566,96465630,96465816,96465833,96466039,96466123,96465257,96469940,96469949,96470011,96470031,96466031,96470133,96470003,96465825,96470242,96470323,96465273,9 (...)"
"                                      ->  Parallel Seq Scan on "TLCDevice" _hardware_21  (cost=0.00..22.67 rows=192 width=226) (actual time=0.004..0.088 rows=164 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "PhysicalServer" _hardware_22  (cost=0.00..26.66 rows=148 width=31) (actual time=0.003..0.059 rows=126 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                            Rows Removed by Filter: 4"
"                                      ->  Parallel Bitmap Heap Scan on "VirtualServer" _hardware_23  (cost=55.42..393.73 rows=1696 width=40) (actual time=0.262..0.995 rows=1442 loops=2)"
"                                            Recheck Cond: ("Status" = 'A'::bpchar)"
"                                            Filter: ((("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011,96465816,96465281,96470 (...)"
"                                            Heap Blocks: exact=88"
"                                            ->  Bitmap Index Scan on "_cm3_VirtualServer_pk_tdb"  (cost=0.00..54.70 rows=2883 width=0) (actual time=0.208..0.208 rows=2883 loops=1)"
"                                      ->  Parallel Seq Scan on "Desktop" _hardware_24  (cost=0.00..1.90 rows=12 width=25) (actual time=0.002..0.005 rows=10 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Mobile" _hardware_25  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                      ->  Parallel Seq Scan on "Notebook" _hardware_26  (cost=0.00..0.00 rows=1 width=226) (actual time=0.000..0.000 rows=0 loops=2)"
"                                            Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,964 (...)"
"                                ->  Hash  (cost=1160.24..1160.24 rows=19836 width=8) (actual time=8.390..8.399 rows=19820 loops=2)"
"                                      Buckets: 32768  Batches: 1  Memory Usage: 1031kB"
"                                      ->  Append  (cost=0.00..1160.24 rows=19836 width=8) (actual time=0.019..6.308 rows=19820 loops=2)"
"                                            ->  Seq Scan on "Hardware"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "ServerHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "ClientHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "PhoneHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Peripheral"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "RackDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.003 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "BladeChassis"  (cost=0.00..1.30 rows=9 width=8) (actual time=0.003..0.007 rows=9 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                                  Rows Removed by Filter: 7"
"                                            ->  Seq Scan on "NetworkDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Server"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Storage"  (cost=0.00..4.41 rows=75 width=8) (actual time=0.004..0.021 rows=75 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "System"  (cost=0.00..34.30 rows=656 width=8) (actual time=0.006..0.155 rows=656 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Computer"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "DesktopDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "MobileDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "SIM"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "TelephoneExchange"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "VideoconfSys"  (cost=0.00..2.94 rows=48 width=8) (actual time=0.003..0.014 rows=48 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                                  Rows Removed by Filter: 2"
"                                            ->  Seq Scan on "Modem"  (cost=0.00..1.53 rows=28 width=8) (actual time=0.004..0.009 rows=28 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Monitor"  (cost=0.00..1.06 rows=3 width=8) (actual time=0.003..0.004 rows=3 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Printer"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "GenericRackDevice"  (cost=0.00..78.55 rows=1564 width=8) (actual time=0.003..0.395 rows=1564 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                                  Rows Removed by Filter: 12"
"                                            ->  Seq Scan on "GenNetDevice"  (cost=0.00..790.24 rows=13956 width=8) (actual time=0.012..3.443 rows=13956 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                                  Rows Removed by Filter: 670"
"                                            ->  Seq Scan on "TLCDevice"  (cost=0.00..14.13 rows=327 width=8) (actual time=0.011..0.096 rows=327 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "PhysicalServer"  (cost=0.00..19.88 rows=251 width=8) (actual time=0.005..0.076 rows=251 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                                  Rows Removed by Filter: 9"
"                                            ->  Index Scan using "_cm3_VirtualServer_IdClass" on "VirtualServer"  (cost=0.28..210.55 rows=2883 width=8) (actual time=0.011..0.833 rows=2883 loops=2)"
"                                                  Filter: (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[]))"
"                                            ->  Seq Scan on "Desktop"  (cost=0.00..1.38 rows=20 width=8) (actual time=0.007..0.012 rows=20 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Mobile"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.003 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                            ->  Seq Scan on "Notebook"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)"
"                                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"Planning time: 20.293 ms"
"Execution time: 42.085 ms"

* Query with ANY ( ARRAY () ):

"Subquery Scan on _rdouther  (cost=1472.17..1476.34 rows=1 width=16) (actual time=104.068..110.576 rows=1 loops=1)"
"  Filter: (_rdouther._id = 64297639)"
"  Rows Removed by Filter: 19819"
"  ->  WindowAgg  (cost=1472.17..1474.95 rows=111 width=16) (actual time=103.262..109.804 rows=19820 loops=1)"
"        ->  Subquery Scan on _rdinner  (cost=1472.17..1473.56 rows=111 width=8) (actual time=103.257..105.829 rows=19820 loops=1)"
"              ->  Sort  (cost=1472.17..1472.45 rows=111 width=862) (actual time=103.257..104.234 rows=19820 loops=1)"
"                    Sort Key: _hardware."Code""
"                    Sort Method: quicksort  Memory: 1774kB"
"                    InitPlan 1 (returns $0)"
"                      ->  Append  (cost=0.00..1160.24 rows=19836 width=8) (actual time=0.006..5.594 rows=19820 loops=1)"
"                            ->  Seq Scan on "Hardware"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "ServerHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "ClientHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "PhoneHW"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Peripheral"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "RackDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "BladeChassis"  (cost=0.00..1.30 rows=9 width=8) (actual time=0.002..0.006 rows=9 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                  Rows Removed by Filter: 7"
"                            ->  Seq Scan on "NetworkDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Server"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Storage"  (cost=0.00..4.41 rows=75 width=8) (actual time=0.002..0.019 rows=75 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "System"  (cost=0.00..34.30 rows=656 width=8) (actual time=0.002..0.141 rows=656 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Computer"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "DesktopDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "MobileDevice"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "SIM"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "TelephoneExchange"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "VideoconfSys"  (cost=0.00..2.94 rows=48 width=8) (actual time=0.002..0.013 rows=48 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                  Rows Removed by Filter: 2"
"                            ->  Seq Scan on "Modem"  (cost=0.00..1.53 rows=28 width=8) (actual time=0.004..0.010 rows=28 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Monitor"  (cost=0.00..1.06 rows=3 width=8) (actual time=0.002..0.002 rows=3 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Printer"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "GenericRackDevice"  (cost=0.00..78.55 rows=1564 width=8) (actual time=0.002..0.337 rows=1564 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                  Rows Removed by Filter: 12"
"                            ->  Seq Scan on "GenNetDevice"  (cost=0.00..790.24 rows=13956 width=8) (actual time=0.002..3.084 rows=13956 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                  Rows Removed by Filter: 670"
"                            ->  Seq Scan on "TLCDevice"  (cost=0.00..14.13 rows=327 width=8) (actual time=0.004..0.070 rows=327 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "PhysicalServer"  (cost=0.00..19.88 rows=251 width=8) (actual time=0.003..0.064 rows=251 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                                  Rows Removed by Filter: 9"
"                            ->  Index Scan using "_cm3_VirtualServer_IdClass" on "VirtualServer"  (cost=0.28..210.55 rows=2883 width=8) (actual time=0.010..0.756 rows=2883 loops=1)"
"                                  Filter: (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[]))"
"                            ->  Seq Scan on "Desktop"  (cost=0.00..1.38 rows=20 width=8) (actual time=0.005..0.009 rows=20 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Mobile"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                            ->  Seq Scan on "Notebook"  (cost=0.00..0.00 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)"
"                                  Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid <> ALL ('{96470051,96465281,96465885,96471239,96471113}'::oid[])))"
"                    ->  Result  (cost=0.00..308.16 rows=111 width=862) (actual time=6.560..97.650 rows=19820 loops=1)"
"                          ->  Append  (cost=0.00..307.05 rows=111 width=92) (actual time=6.559..95.840 rows=19820 loops=1)"
"                                ->  Seq Scan on "Hardware" _hardware  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "ServerHW" _hardware_1  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "ClientHW" _hardware_2  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "PhoneHW" _hardware_3  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Peripheral" _hardware_4  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "RackDevice" _hardware_5  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "BladeChassis" _hardware_6  (cost=0.00..2.42 rows=4 width=29) (actual time=6.552..6.557 rows=9 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                      Rows Removed by Filter: 7"
"                                ->  Seq Scan on "NetworkDevice" _hardware_7  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Server" _hardware_8  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Storage" _hardware_9  (cost=0.00..9.66 rows=9 width=28) (actual time=0.004..0.055 rows=75 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Bitmap Heap Scan on "System" _hardware_10  (cost=18.83..38.45 rows=10 width=226) (actual time=13.303..13.569 rows=656 loops=1)"
"                                      Recheck Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                      Heap Blocks: exact=22"
"                                      ->  Bitmap Index Scan on "System_pkey"  (cost=0.00..18.82 rows=10 width=0) (actual time=13.294..13.295 rows=656 loops=1)"
"                                            Index Cond: ("Id" = ANY ($0))"
"                                ->  Seq Scan on "Computer" _hardware_11  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "DesktopDevice" _hardware_12  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "MobileDevice" _hardware_13  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "TelephoneExchange" _hardware_14  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "VideoconfSys" _hardware_15  (cost=0.00..6.44 rows=9 width=22) (actual time=0.007..0.233 rows=48 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                      Rows Removed by Filter: 2"
"                                ->  Seq Scan on "Modem" _hardware_16  (cost=0.00..3.48 rows=9 width=34) (actual time=0.008..0.141 rows=28 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Monitor" _hardware_17  (cost=0.00..1.27 rows=3 width=25) (actual time=0.007..0.018 rows=3 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Printer" _hardware_18  (cost=0.00..0.00 rows=1 width=226) (actual time=0.001..0.001 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Bitmap Heap Scan on "GenericRackDevice" _hardware_19  (cost=26.85..54.19 rows=10 width=36) (actual time=14.192..14.695 rows=1564 loops=1)"
"                                      Recheck Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                      Heap Blocks: exact=49"
"                                      ->  Bitmap Index Scan on "GenericRackDevice_pkey"  (cost=0.00..26.85 rows=10 width=0) (actual time=14.182..14.182 rows=1564 loops=1)"
"                                            Index Cond: ("Id" = ANY ($0))"
"                                ->  Bitmap Heap Scan on "GenNetDevice" _hardware_20  (cost=38.93..75.64 rows=10 width=34) (actual time=15.619..19.434 rows=13956 loops=1)"
"                                      Recheck Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                      Heap Blocks: exact=516"
"                                      ->  Bitmap Index Scan on "GenNetDevice_pkey"  (cost=0.00..38.93 rows=10 width=0) (actual time=15.570..15.570 rows=13956 loops=1)"
"                                            Index Cond: ("Id" = ANY ($0))"
"                                ->  Bitmap Heap Scan on "TLCDevice" _hardware_21  (cost=9.55..18.80 rows=10 width=226) (actual time=10.329..10.485 rows=327 loops=1)"
"                                      Recheck Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                      Heap Blocks: exact=8"
"                                      ->  Bitmap Index Scan on "TLCDevice_pkey"  (cost=0.00..9.55 rows=10 width=0) (actual time=10.317..10.317 rows=327 loops=1)"
"                                            Index Cond: ("Id" = ANY ($0))"
"                                ->  Bitmap Heap Scan on "PhysicalServer" _hardware_22  (cost=9.55..24.91 rows=9 width=31) (actual time=10.325..10.442 rows=251 loops=1)"
"                                      Recheck Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                      Heap Blocks: exact=15"
"                                      ->  Bitmap Index Scan on "PhysicalServer_pkey"  (cost=0.00..9.55 rows=10 width=0) (actual time=10.317..10.317 rows=251 loops=1)"
"                                            Index Cond: ("Id" = ANY ($0))"
"                                ->  Index Scan using "VirtualServer_pkey" on "VirtualServer" _hardware_23  (cost=0.28..69.03 rows=5 width=40) (actual time=11.880..16.751 rows=2883 loops=1)"
"                                      Index Cond: ("Id" = ANY ($0))"
"                                      Filter: (("Status" = 'A'::bpchar) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469949,96471323,96471011, (...)"
"                                ->  Seq Scan on "Desktop" _hardware_24  (cost=0.00..2.77 rows=8 width=25) (actual time=0.119..2.330 rows=20 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Mobile" _hardware_25  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"                                ->  Seq Scan on "Notebook" _hardware_26  (cost=0.00..0.00 rows=1 width=226) (actual time=0.002..0.002 rows=0 loops=1)"
"                                      Filter: (("Status" = 'A'::bpchar) AND ("Id" = ANY ($0)) AND (("IdClass")::oid = ANY ('{96466039,96471219,96465885,96470133,96471113,96471239,96470323,96469940,96470051,96471133,96471363,96466123,96470031,96465833,96469 (...)"
"Planning time: 17.877 ms"
"Execution time: 110.774 ms"

I've executed everything on postgres 10.14 and on postgres 9.5.23, encountering the same results.
What is the cause of the difference in the results? Could it be something related to the parallel sequence scan? Is this considerable a bug or am I missing something in the behavior of the operator?

Thanks in advance for any support.
Davide Jensen

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: New "function tables" in V13 documentation
Следующее
От: Dirk Krautschick
Дата:
Сообщение: Backup Restore from other node after switchover/failover