问:
How do I use a noindex hint in the outermost query of a nested query?
I have a query structure where I've got 3 nested queries (e.g. select * from (select * from (select * from table ) a ) b

There's an index in trying to avoid,  because it was causing long run times. It appeared twice in the plan. I used a noindex hint on the innermost query to remove one instance of it, but I can't seem to get rid of the second instance.

Is there a way to use noindex on the outer queries of a nested query?

Edit: More detailed query example. Note, in the real query there are GROUP BY statements on every level, but a WHERE statement only in the innermost query.

```<code>Select /*+ parallel(8) no_index(b,bad_index)  */
 b.col1
 b.col2
 b.col3
FROM
  (Select /*+ parallel(8) no_index(a,bad_index)  */
    a.col1
    a.col2
    a.col3
  FROM
(SELECT  /*+ parallel(8) no_index(t,bad_index)  */
       t.col1
       t.col2
       t.col3

    FROM table_1 t
    INNER JOIN table_2 t2
          ON t.col1=t2.col1
    WHERE
        t.col2='value' ) a
) b
</code>```

Plan is below. Note, this is the actual execution plan that I changed the names  of the tables for anonymity. There are joins I didn't include in the example for simplicity's sake. Lines 72/73 include the index that I'm trying to avoid.  I added the predicate information.

```<code>   | Id   | Operation                                                                       | Name                      | Rows      | Bytes       | Cost    | Time     |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
|    0 | SELECT STATEMENT                                                                |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    1 |   PX COORDINATOR                                                                |                           |           |             |         |          |
|    2 |    PX SEND QC (RANDOM)                                                          | :TQ10014                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    3 |     SORT GROUP BY                                                               |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    4 |      PX RECEIVE                                                                 |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    5 |       PX SEND HASH                                                              | :TQ10013                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    6 |        SORT GROUP BY                                                            |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    7 |         PX RECEIVE                                                              |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    8 |          PX SEND HASH                                                           | :TQ10012                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    9 |           SORT GROUP BY                                                         |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|   10 |            VIEW                                                                 |                           |  84613730 | 20138067740 | 5135062 | 00:03:21 |
|   11 |             WINDOW SORT                                                         |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   12 |              PX RECEIVE                                                         |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   13 |               PX SEND HASH                                                      | :TQ10011                  |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   14 |                WINDOW BUFFER                                                    |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   15 |                 SORT GROUP BY                                                   |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   16 |                  PX RECEIVE                                                     |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   17 |                   PX SEND HASH                                                  | :TQ10010                  |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   18 |                    HASH GROUP BY                                                |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   19 |                     VIEW                                                        |                           |  84613730 | 22338024720 | 4201665 | 00:02:45 |
|   20 |                      WINDOW SORT                                                |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   21 |                       PX RECEIVE                                                |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   22 |                        PX SEND HASH                                             | :TQ10009                  |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   23 |                         WINDOW BUFFER                                           |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   24 |                          SORT GROUP BY                                          |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   25 |                           PX RECEIVE                                            |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   26 |                            PX SEND HASH                                         | :TQ10008                  |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   27 |                             HASH GROUP BY                                       |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
| * 28 |                              HASH JOIN                                          |                           |  84613730 | 33760878270 | 2809746 | 00:01:50 |
|   29 |                               PX RECEIVE                                        |                           |     48812 |     1366736 |       2 | 00:00:01 |
|   30 |                                PX SEND BROADCAST                                | :TQ10003                  |     48812 |     1366736 |       2 | 00:00:01 |
|   31 |                                 PX BLOCK ITERATOR                               |                           |     48812 |     1366736 |       2 | 00:00:01 |
|   32 |                                  TABLE ACCESS STORAGE FULL                      | Table5       |     48812 |     1366736 |       2 | 00:00:01 |
| * 33 |                               HASH JOIN RIGHT OUTER                             |                           |  84350244 | 31293940524 | 2809707 | 00:01:50 |
|   34 |                                PX RECEIVE                                       |                           |     48812 |     1025052 |       2 | 00:00:01 |
|   35 |                                 PX SEND BROADCAST                               | :TQ10004                  |     48812 |     1025052 |       2 | 00:00:01 |
|   36 |                                  PX BLOCK ITERATOR                              |                           |     48812 |     1025052 |       2 | 00:00:01 |
|   37 |                                   TABLE ACCESS STORAGE FULL                     | Table5       |     48812 |     1025052 |       2 | 00:00:01 |
| * 38 |                                HASH JOIN RIGHT OUTER                            |                           |  84087578 | 29430652300 | 2809669 | 00:01:50 |
|   39 |                                 PX RECEIVE                                      |                           |     37177 |      669186 |       3 | 00:00:01 |
|   40 |                                  PX SEND BROADCAST                              | :TQ10005                  |     37177 |      669186 |       3 | 00:00:01 |
|   41 |                                   PX BLOCK ITERATOR                             |                           |     37177 |      669186 |       3 | 00:00:01 |
|   42 |                                    TABLE ACCESS STORAGE FULL                    | Table4              |     37177 |      669186 |       3 | 00:00:01 |
| * 43 |                                 HASH JOIN                                       |                           |  84087578 | 27917075896 | 2809629 | 00:01:50 |
|   44 |                                  TABLE ACCESS STORAGE FULL                      | Table4                |     37177 |      669186 |       3 | 00:00:01 |
| * 45 |                                  HASH JOIN OUTER                                |                           |  84087578 | 26403499492 | 2809590 | 00:01:50 |
|   46 |                                   JOIN FILTER CREATE                            | :BF0000                   |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   47 |                                    PX RECEIVE                                   |                           |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   48 |                                     PX SEND HASH (NULL RANDOM)                  | :TQ10006                  |  84087578 | 17490216224 | 2134146 | 00:01:24 |
| * 49 |                                      HASH JOIN BUFFERED                         |                           |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   50 |                                       PART JOIN FILTER CREATE                   | :BF0001                   | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   51 |                                        PX RECEIVE                               |                           | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   52 |                                         PX SEND HASH                            | :TQ10000                  | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   53 |                                          PX PARTITION LIST INLIST               |                           | 345508495 | 11401780335 |  589579 | 00:00:24 |
| * 54 |                                           TABLE ACCESS STORAGE FULL             | Table3 | 345508495 | 11401780335 |  589579 | 00:00:24 |
| * 55 |                                       HASH JOIN                                 |                           |  84087578 | 14715326150 | 1532914 | 00:01:00 |
|   56 |                                        JOIN FILTER CREATE                       | :BF0003                   |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   57 |                                         PART JOIN FILTER CREATE                 | :BF0002                   |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   58 |                                          PX RECEIVE                             |                           |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   59 |                                           PX SEND HASH                          | :TQ10001                  |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   60 |                                            PX PARTITION LIST INLIST             |                           |  84087578 | 12276786388 | 1201043 | 00:00:47 |
| * 61 |                                             TABLE ACCESS STORAGE FULL           | Table1      |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   62 |                                        PX RECEIVE                               |                           | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   63 |                                         PX SEND HASH                            | :TQ10002                  | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   64 |                                          JOIN FILTER USE                        | :BF0003                   | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   65 |                                           PX PARTITION LIST INLIST              |                           | 388151817 | 11256402693 |  320877 | 00:00:13 |
| * 66 |                                            TABLE ACCESS STORAGE FULL            |Table2           | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   67 |                                   PX RECEIVE                                    |                           | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   68 |                                    PX SEND HASH                                 | :TQ10007                  | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   69 |                                     JOIN FILTER USE                             | :BF0000                   | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   70 |                                      PX PARTITION LIST INLIST                   |                           | 191371730 | 20285403380 |  660306 | 00:00:26 |
| * 71 |                                       TABLE ACCESS BY LOCAL INDEX ROWID BATCHED | Table1      | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   72 |                                        BITMAP CONVERSION TO ROWIDS              |                           |           |             |         |          |
| * 73 |                                         BITMAP INDEX RANGE SCAN                 | BAD_INDEX     |           |             |         |          |

   * 73 - access("B"."date_field"(+)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')))
* 73 - filter(NVL("B"."date_field"(+),99990101)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')) AND
  "B"."date_field"(+)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')))
</code>```

答:
First of all, you need to look into the extended syntax of the no_index hint:

```<code>no_index( [queryblock] tablespec [indexspec])
</code>```

where tablespec is

So for example for this query:

Select
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
```
<p>You can use <code>no_index(b.a.t2)</code>, ie outer inline view b, then inner inline view a, and finally your table alias.
BUT(!) don't forget about official note:</p>
<blockquote>
<p><strong>Note</strong>: Specifying a global hint using the tablespec clause does not work for queries that use <strong>ANSI</strong> joins, because the optimizer generates additional views during parsing. Instead, specify @queryblock to indicate the query block to which the hint applies.</p>
</blockquote>
<p>So for ANSI joins (queries with <code>join</code>), it's better to use <code>@queryblock</code>. And it's easier to use explain plan additional sections like <code>alias, projection, note, report_hint</code>. You can do it easily with <code>format=>'all'</code>, but I would suggest also <code>+outline</code> and <code>+hint_report</code>, for example:</p>
```select * from table(dbms_xplan.display(format=>'all +outline +hint_report'));
```
<p>From the doc:</p>
<blockquote>
<p><strong>format</strong>
Controls the level of details for the plan. It accepts the following values:</p>
<ul>
<li>BASIC: Displays the minimum information in the plan—the operation ID, the operation name and its option.</li>
<li>TYPICAL: This is the default. Displays the most relevant information in the plan (operation id, name and option, #rows, #bytes and optimizer cost). Pruning, parallel and predicate information are only displayed when applicable. Excludes only PROJECTION, ALIAS, and REMOTE SQL information (see below).</li>
<li>SERIAL: Like TYPICAL except that the parallel information is not displayed, even if the plan executes in parallel.</li>
<li>ALL: Maximum user level. Includes information displayed with the TYPICAL level with additional information (PROJECTION, ALIAS and information about REMOTE SQL if the operation is distributed).</li>
</ul>
</blockquote>
<p><em>In fact, 'ALL' is not a "Maximum level". There is also more detailed format - <code>advanced</code>, but it's not documented officially (though you can find it on MOS), so I wouldn't suggest it.</em></p>
<p>For example, we have these tables and indexes:</p>
<pre class="lang-sql prettyprint-override"><code>create table table_1(col1 primary key,col2,col3)
  as select
        level,
        trunc(level/10) as col2,
        rpad('x',100) as col3
     from dual
     connect by level<=10000;
create table table_2(col1,col2,col3)
  as select
        level,
        trunc(level/10) as col2,
        rpad('x',100) as col3
     from dual
     connect by level<=10000;
create index BAD_INDEX on table_2(col2,col1);
</code>```

Let's get an execution plan for this query:

explain plan for
Select
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));

```
<p>Execution plan:</p>
```PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 2962753836

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    12   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    12   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    12   (0)| 00:00:01 |
|*  3 |    INDEX RANGE SCAN          | BAD_INDEX    |    10 |    80 |     2   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]
```
<p>As you can see, we have NESTED LOOPS with 2 index access here:
line #3 - IRS (Index Range Scan) by BAD_INDEX, and line #4 IUS (Index Unique Scan).
and in the <code>OUTLINE</code> section we see 4 most interesting hints for us:</p>
```      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))
```
<p>So for example, if we want to disable index access to T2, we can look at the outline hint
<code>INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))</code>
take the query block (QBName for short) from it - <code>@"SEL$535BA485"</code> and table alias - <code>"T2"@"SEL$3"</code> and add use them in our hint as <code>NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3" BAD_INDEX)</code></p>
<p>Example #2:</p>
<pre class="lang-sql prettyprint-override"><code>explain plan for
Select--+ NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3")
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));

</code>```

Execution plan #2:

```<code>PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 247834218

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    58   (0)| 00:00:01 |
|*  3 |    TABLE ACCESS FULL         | TABLE_2      |    10 |    80 |    48   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      FULL(@"SEL$535BA485" "T2"@"SEL$3")
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 1
---------------------------------------------------------------------------

   3 -  SEL$535BA485 / T2@SEL$3
           -  NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3")
</code>```

As you can see, IRS was replaced to FTS (Full Table Scan - TABLE ACCESS FULL in the plan) and hint_report section shows that our hint was used successfully.

In fact, this example query is too simple and CBO can understand even standard no_index(b.a.t2) here (example below), but don't forget that it may not work for more complex ANSI syntax as I mentioned above.

```<code>explain plan for
Select--+ NO_INDEX(b.a.t2)
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));
</code>```

Example #3:

```<code>PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 247834218

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    58   (0)| 00:00:01 |
|*  3 |    TABLE ACCESS FULL         | TABLE_2      |    10 |    80 |    48   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      FULL(@"SEL$535BA485" "T2"@"SEL$3")
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      OPT_PARAM('_optimizer_nlj_hj_adaptive_join' 'false')
      OPT_PARAM('_optimizer_strans_adaptive_pruning' 'false')
      OPT_PARAM('_px_adaptive_dist_method' 'off')
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 1
---------------------------------------------------------------------------

   3 -  SEL$535BA485 / T2@SEL$3
           -  NO_INDEX(b.a.t2)
</code>```

Finally, all examples on DBFiddle:
https://dbfiddle.uk/?rdbms=oracle_21&fiddle=5d4a44a13cb5ca3920794caedeaab44d

Body:
I have a query structure where I've got 3 nested queries (e.g. select * from (select * from (select * from table ) a ) b

There's an index in trying to avoid,  because it was causing long run times. It appeared twice in the plan. I used a noindex hint on the innermost query to remove one instance of it, but I can't seem to get rid of the second instance.

Is there a way to use noindex on the outer queries of a nested query?

Edit: More detailed query example. Note, in the real query there are GROUP BY statements on every level, but a WHERE statement only in the innermost query.

Select /*+ parallel(8) no_index(b,bad_index)  */
 b.col1
 b.col2
 b.col3
FROM
  (Select /*+ parallel(8) no_index(a,bad_index)  */
    a.col1
    a.col2
    a.col3
  FROM
(SELECT  /*+ parallel(8) no_index(t,bad_index)  */
       t.col1
       t.col2
       t.col3

    FROM table_1 t
    INNER JOIN table_2 t2
          ON t.col1=t2.col1
    WHERE
        t.col2='value' ) a
) b

Plan is below. Note, this is the actual execution plan that I changed the names  of the tables for anonymity. There are joins I didn't include in the example for simplicity's sake. Lines 72/73 include the index that I'm trying to avoid.  I added the predicate information.

   | Id   | Operation                                                                       | Name                      | Rows      | Bytes       | Cost    | Time     |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
|    0 | SELECT STATEMENT                                                                |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    1 |   PX COORDINATOR                                                                |                           |           |             |         |          |
|    2 |    PX SEND QC (RANDOM)                                                          | :TQ10014                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    3 |     SORT GROUP BY                                                               |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    4 |      PX RECEIVE                                                                 |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    5 |       PX SEND HASH                                                              | :TQ10013                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    6 |        SORT GROUP BY                                                            |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    7 |         PX RECEIVE                                                              |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    8 |          PX SEND HASH                                                           | :TQ10012                  |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|    9 |           SORT GROUP BY                                                         |                           |  84613730 | 20138067740 | 5534656 | 00:03:37 |
|   10 |            VIEW                                                                 |                           |  84613730 | 20138067740 | 5135062 | 00:03:21 |
|   11 |             WINDOW SORT                                                         |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   12 |              PX RECEIVE                                                         |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   13 |               PX SEND HASH                                                      | :TQ10011                  |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   14 |                WINDOW BUFFER                                                    |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   15 |                 SORT GROUP BY                                                   |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   16 |                  PX RECEIVE                                                     |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   17 |                   PX SEND HASH                                                  | :TQ10010                  |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   18 |                    HASH GROUP BY                                                |                           |  84613730 | 22338024720 | 5135062 | 00:03:21 |
|   19 |                     VIEW                                                        |                           |  84613730 | 22338024720 | 4201665 | 00:02:45 |
|   20 |                      WINDOW SORT                                                |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   21 |                       PX RECEIVE                                                |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   22 |                        PX SEND HASH                                             | :TQ10009                  |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   23 |                         WINDOW BUFFER                                           |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   24 |                          SORT GROUP BY                                          |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   25 |                           PX RECEIVE                                            |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   26 |                            PX SEND HASH                                         | :TQ10008                  |  84613730 | 33760878270 | 4201665 | 00:02:45 |
|   27 |                             HASH GROUP BY                                       |                           |  84613730 | 33760878270 | 4201665 | 00:02:45 |
| * 28 |                              HASH JOIN                                          |                           |  84613730 | 33760878270 | 2809746 | 00:01:50 |
|   29 |                               PX RECEIVE                                        |                           |     48812 |     1366736 |       2 | 00:00:01 |
|   30 |                                PX SEND BROADCAST                                | :TQ10003                  |     48812 |     1366736 |       2 | 00:00:01 |
|   31 |                                 PX BLOCK ITERATOR                               |                           |     48812 |     1366736 |       2 | 00:00:01 |
|   32 |                                  TABLE ACCESS STORAGE FULL                      | Table5       |     48812 |     1366736 |       2 | 00:00:01 |
| * 33 |                               HASH JOIN RIGHT OUTER                             |                           |  84350244 | 31293940524 | 2809707 | 00:01:50 |
|   34 |                                PX RECEIVE                                       |                           |     48812 |     1025052 |       2 | 00:00:01 |
|   35 |                                 PX SEND BROADCAST                               | :TQ10004                  |     48812 |     1025052 |       2 | 00:00:01 |
|   36 |                                  PX BLOCK ITERATOR                              |                           |     48812 |     1025052 |       2 | 00:00:01 |
|   37 |                                   TABLE ACCESS STORAGE FULL                     | Table5       |     48812 |     1025052 |       2 | 00:00:01 |
| * 38 |                                HASH JOIN RIGHT OUTER                            |                           |  84087578 | 29430652300 | 2809669 | 00:01:50 |
|   39 |                                 PX RECEIVE                                      |                           |     37177 |      669186 |       3 | 00:00:01 |
|   40 |                                  PX SEND BROADCAST                              | :TQ10005                  |     37177 |      669186 |       3 | 00:00:01 |
|   41 |                                   PX BLOCK ITERATOR                             |                           |     37177 |      669186 |       3 | 00:00:01 |
|   42 |                                    TABLE ACCESS STORAGE FULL                    | Table4              |     37177 |      669186 |       3 | 00:00:01 |
| * 43 |                                 HASH JOIN                                       |                           |  84087578 | 27917075896 | 2809629 | 00:01:50 |
|   44 |                                  TABLE ACCESS STORAGE FULL                      | Table4                |     37177 |      669186 |       3 | 00:00:01 |
| * 45 |                                  HASH JOIN OUTER                                |                           |  84087578 | 26403499492 | 2809590 | 00:01:50 |
|   46 |                                   JOIN FILTER CREATE                            | :BF0000                   |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   47 |                                    PX RECEIVE                                   |                           |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   48 |                                     PX SEND HASH (NULL RANDOM)                  | :TQ10006                  |  84087578 | 17490216224 | 2134146 | 00:01:24 |
| * 49 |                                      HASH JOIN BUFFERED                         |                           |  84087578 | 17490216224 | 2134146 | 00:01:24 |
|   50 |                                       PART JOIN FILTER CREATE                   | :BF0001                   | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   51 |                                        PX RECEIVE                               |                           | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   52 |                                         PX SEND HASH                            | :TQ10000                  | 345508495 | 11401780335 |  589579 | 00:00:24 |
|   53 |                                          PX PARTITION LIST INLIST               |                           | 345508495 | 11401780335 |  589579 | 00:00:24 |
| * 54 |                                           TABLE ACCESS STORAGE FULL             | Table3 | 345508495 | 11401780335 |  589579 | 00:00:24 |
| * 55 |                                       HASH JOIN                                 |                           |  84087578 | 14715326150 | 1532914 | 00:01:00 |
|   56 |                                        JOIN FILTER CREATE                       | :BF0003                   |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   57 |                                         PART JOIN FILTER CREATE                 | :BF0002                   |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   58 |                                          PX RECEIVE                             |                           |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   59 |                                           PX SEND HASH                          | :TQ10001                  |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   60 |                                            PX PARTITION LIST INLIST             |                           |  84087578 | 12276786388 | 1201043 | 00:00:47 |
| * 61 |                                             TABLE ACCESS STORAGE FULL           | Table1      |  84087578 | 12276786388 | 1201043 | 00:00:47 |
|   62 |                                        PX RECEIVE                               |                           | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   63 |                                         PX SEND HASH                            | :TQ10002                  | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   64 |                                          JOIN FILTER USE                        | :BF0003                   | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   65 |                                           PX PARTITION LIST INLIST              |                           | 388151817 | 11256402693 |  320877 | 00:00:13 |
| * 66 |                                            TABLE ACCESS STORAGE FULL            |Table2           | 388151817 | 11256402693 |  320877 | 00:00:13 |
|   67 |                                   PX RECEIVE                                    |                           | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   68 |                                    PX SEND HASH                                 | :TQ10007                  | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   69 |                                     JOIN FILTER USE                             | :BF0000                   | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   70 |                                      PX PARTITION LIST INLIST                   |                           | 191371730 | 20285403380 |  660306 | 00:00:26 |
| * 71 |                                       TABLE ACCESS BY LOCAL INDEX ROWID BATCHED | Table1      | 191371730 | 20285403380 |  660306 | 00:00:26 |
|   72 |                                        BITMAP CONVERSION TO ROWIDS              |                           |           |             |         |          |
| * 73 |                                         BITMAP INDEX RANGE SCAN                 | BAD_INDEX     |           |             |         |          |

   * 73 - access("B"."date_field"(+)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')))
* 73 - filter(NVL("B"."date_field"(+),99990101)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')) AND
  "B"."date_field"(+)>=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!-INTERVAL'+00-06' YEAR(2) TO MONTH),'YYYYMMDD')))

Body:
First of all, you need to look into the extended syntax of the no_index hint:

no_index( [queryblock] tablespec [indexspec])

where tablespec is

So for example for this query:

Select
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;

You can use no_index(b.a.t2), ie outer inline view b, then inner inline view a, and finally your table alias.
BUT(!) don't forget about official note:

Note: Specifying a global hint using the tablespec clause does not work for queries that use ANSI joins, because the optimizer generates additional views during parsing. Instead, specify @queryblock to indicate the query block to which the hint applies.

So for ANSI joins (queries with join), it's better to use @queryblock. And it's easier to use explain plan additional sections like alias, projection, note, report_hint. You can do it easily with format=>'all', but I would suggest also +outline and +hint_report, for example:

select * from table(dbms_xplan.display(format=>'all +outline +hint_report'));

From the doc:

format
Controls the level of details for the plan. It accepts the following values:

BASIC: Displays the minimum information in the plan—the operation ID, the operation name and its option.

TYPICAL: This is the default. Displays the most relevant information in the plan (operation id, name and option, #rows, #bytes and optimizer cost). Pruning, parallel and predicate information are only displayed when applicable. Excludes only PROJECTION, ALIAS, and REMOTE SQL information (see below).

SERIAL: Like TYPICAL except that the parallel information is not displayed, even if the plan executes in parallel.

ALL: Maximum user level. Includes information displayed with the TYPICAL level with additional information (PROJECTION, ALIAS and information about REMOTE SQL if the operation is distributed).

In fact, 'ALL' is not a "Maximum level". There is also more detailed format - advanced, but it's not documented officially (though you can find it on MOS), so I wouldn't suggest it.

For example, we have these tables and indexes:

create table table_1(col1 primary key,col2,col3)
  as select
        level,
        trunc(level/10) as col2,
        rpad('x',100) as col3
     from dual
     connect by level<=10000;
create table table_2(col1,col2,col3)
  as select
        level,
        trunc(level/10) as col2,
        rpad('x',100) as col3
     from dual
     connect by level<=10000;
create index BAD_INDEX on table_2(col2,col1);

Let's get an execution plan for this query:

explain plan for
Select
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));

Execution plan:

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 2962753836

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    12   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    12   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    12   (0)| 00:00:01 |
|*  3 |    INDEX RANGE SCAN          | BAD_INDEX    |    10 |    80 |     2   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]

As you can see, we have NESTED LOOPS with 2 index access here:
line #3 - IRS (Index Range Scan) by BAD_INDEX, and line #4 IUS (Index Unique Scan).
and in the OUTLINE section we see 4 most interesting hints for us:

      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))

So for example, if we want to disable index access to T2, we can look at the outline hint
INDEX(@"SEL$535BA485" "T2"@"SEL$3" ("TABLE_2"."COL2" "TABLE_2"."COL1"))
take the query block (QBName for short) from it - @"SEL$535BA485" and table alias - "T2"@"SEL$3" and add use them in our hint as NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3" BAD_INDEX)

Example #2:

explain plan for
Select--+ NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3")
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));

Execution plan #2:

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 247834218

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    58   (0)| 00:00:01 |
|*  3 |    TABLE ACCESS FULL         | TABLE_2      |    10 |    80 |    48   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      FULL(@"SEL$535BA485" "T2"@"SEL$3")
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 1
---------------------------------------------------------------------------

   3 -  SEL$535BA485 / T2@SEL$3
           -  NO_INDEX(@"SEL$535BA485" "T2"@"SEL$3")

As you can see, IRS was replaced to FTS (Full Table Scan - TABLE ACCESS FULL in the plan) and hint_report section shows that our hint was used successfully.

In fact, this example query is too simple and CBO can understand even standard no_index(b.a.t2) here (example below), but don't forget that it may not work for more complex ANSI syntax as I mentioned above.

explain plan for
Select--+ NO_INDEX(b.a.t2)
 b.col1,
 b.col2,
 b.col3
FROM
  (Select
    a.col1,
    a.col2,
    a.col3
  FROM
   (SELECT
       t.col1,
       t.col2,
       t.col3
    FROM table_1 t
    JOIN table_2 t2
         on t.col1 = t2.col1
    WHERE
        t2.col2=:bind
   ) a
) b;
select * from table(dbms_xplan.display('','','all +outline +hint_report'));

Example #3:

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 247834218

---------------------------------------------------------------------------------------------
| Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |              |    10 |  1170 |    58   (0)| 00:00:01 |
|   2 |   NESTED LOOPS               |              |    10 |  1170 |    58   (0)| 00:00:01 |
|*  3 |    TABLE ACCESS FULL         | TABLE_2      |    10 |    80 |    48   (0)| 00:00:01 |
|*  4 |    INDEX UNIQUE SCAN         | SYS_C0010147 |     1 |       |     0   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TABLE_1      |     1 |   109 |     1   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - SEL$535BA485
   3 - SEL$535BA485 / T2@SEL$3
   4 - SEL$535BA485 / T@SEL$3
   5 - SEL$535BA485 / T@SEL$3

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      NLJ_BATCHING(@"SEL$535BA485" "T"@"SEL$3")
      USE_NL(@"SEL$535BA485" "T"@"SEL$3")
      LEADING(@"SEL$535BA485" "T2"@"SEL$3" "T"@"SEL$3")
      INDEX(@"SEL$535BA485" "T"@"SEL$3" ("TABLE_1"."COL1"))
      FULL(@"SEL$535BA485" "T2"@"SEL$3")
      OUTLINE(@"SEL$3")
      OUTLINE(@"SEL$4")
      MERGE(@"SEL$3" >"SEL$4")
      OUTLINE(@"SEL$37633EB5")
      OUTLINE(@"SEL$2")
      MERGE(@"SEL$37633EB5" >"SEL$2")
      OUTLINE(@"SEL$BB1798A6")
      OUTLINE(@"SEL$1")
      MERGE(@"SEL$BB1798A6" >"SEL$1")
      OUTLINE_LEAF(@"SEL$535BA485")
      ALL_ROWS
      OPT_PARAM('_optimizer_nlj_hj_adaptive_join' 'false')
      OPT_PARAM('_optimizer_strans_adaptive_pruning' 'false')
      OPT_PARAM('_px_adaptive_dist_method' 'off')
      DB_VERSION('19.1.0')
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      IGNORE_OPTIM_EMBEDDED_HINTS
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter("T2"."COL2"=TO_NUMBER(:BIND))
   4 - access("T"."COL1"="T2"."COL1")

Column Projection Information (identified by operation id):
-----------------------------------------------------------

   1 - (#keys=0) "T"."COL1"[NUMBER,22], "T"."COL2"[NUMBER,22],
       "T"."COL3"[VARCHAR2,100]
   2 - (#keys=0) "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   3 - "T2"."COL1"[NUMBER,22]
   4 - "T".ROWID[ROWID,10], "T"."COL1"[NUMBER,22]
   5 - "T"."COL2"[NUMBER,22], "T"."COL3"[VARCHAR2,100]

Hint Report (identified by operation id / Query Block Name / Object Alias):
Total hints for statement: 1
---------------------------------------------------------------------------

   3 -  SEL$535BA485 / T2@SEL$3
           -  NO_INDEX(b.a.t2)

Finally, all examples on DBFiddle:
https://dbfiddle.uk/?rdbms=oracle_21&fiddle=5d4a44a13cb5ca3920794caedeaab44d


来源: stackexchange

问:
How to contain diff between two local git branches
I have same working directory but often keeps switching between two branches whose git head is at different points and also different local changes. Without pushing the diff to remote repo is there a way to maintain/ restrict the changes and not overwrite it when switching from one branch to another branch. I am not sure if git would track locally in this way? Please help

Say i am on branch 1 made some changes i.e. diff1, didnot stash this. Now i want to switch to another branch 2, at this point git complains either to commit or stash changes (diff1)? I am asking if we can switch to branch 2 without having to stash/ discard/ commit diff1 changes? somehow switch to branch 2 and work on changes, now when issued git diff it should show diff2 but not diff1. Dont know if this is even possible.

答:
TL;DR

Your best bet is almost certainly git worktree.

Long

You have several wrong starting-point ideas, that you'll need to get rid of, before you can solve your basic problems here:

Git doesn't store changes in the first place.  Git stores commits.

Git therefore doesn't push changes either.  You push commits.

Commits don't go anywhere until you send them somewhere.

git stash itself makes commits; we'll see why in a moment.

You therefore need to know all about commits.  For much more about this, see, e.g., my answer here.  To cut to the chase, though, each commit's saved content is entirely read-only.  You literally can't work on a commit without first copying that commit out to a work area.

The files you're modifying, in other words, are not in Git at all.  They came out of Git earlier, and when you have them ready, you will put them back into Git.  But right now they're just ordinary files that aren't in Git.  Git can't save them if you wreck them, and that's why you—sometimes!—get:

```<code>error: Your local changes to the following files would be overwritten ...
</code>```

It's because your files, in your working tree, will have to be destroyed (removed and replaced with other files) in order to switch to the other commit.  Git has checked, and what's in these files isn't what's saved forever in the commit.

Switching from one commit to another involves replacing files in your working tree—sometimes!  That's the source of the "sometimes" above.  If you're switching between two very different commits, most files will need to be replaced.  If you're switching between two very similar commits, only a few files will need to be replaced, and sometimes you'll be able to do it anyway (see Checkout another branch when there are uncommitted changes on the current branch).

Using git stash makes commits: this saves your work.  The commits that git stash makes are on no branch, which has two side effects that people find desirable:

You can't see these commits easily.

You can move the effect of these commits to some other branch easily.

It has other side effects that people find undesirable, including the fact that you can't see these commits easily.  That is, the first side effect is both boon and burden.

The long and short of it, though, is that if you wish to switch the current branch and therefore also the current commit in the (single) working tree, you must do something about / with any changes you have.  That thing you do can be any one of the following, or anything else you can think of:

leave them and hope;

stash them for later;

commit them—much the same as stashing, except now you can see the commits;

eradicate them entirely, with the intent of reproducing them later.

Multiple working trees

The key phrase above is:

switch the current branch and therefore also the current commit in the (single) working tree

Until Git version 2.5, Git only offered one working tree per clone.  So to get a second working tree, you had to clone again, or clone your clone (either method can work though cloning-again avoids the need to properly learn and understand references and refspecs).  Git 2.5 added git worktree, though, and Git 2.15 finally fixed a pretty nasty bug with git worktree.  So if your Git is at least 2.5, and preferably at least 2.15, you can use this method.  (If your Git is older, consider upgrading.)

With git worktree add, you tell Git: I'd like to add another working tree and corresponding index / staging-area to this repository.  You tell Git which branch should be checked out in this second working tree, and Git will check out that particular branch.  There is a constraint here: each branch in each added working tree can be used only in that one working tree.  (There is a good reason for this constraint; you can get around it by deleting the extra working trees, or changing the checked-out branches in them, but in general you should just work within the constraint until you're done.)

Since each added working tree is an added working tree, with its own index / staging-area, you can now simply cd into a different directory, and/or open an additional window or set of windows to work in/on the other branch.  Because they are separate, the two separate working trees won't interfere with each other unless you do something to make that happen.

See the git worktree documentation for further details.

ContentLicense: CC BY-SA 4.0

Body:
TL;DR

Your best bet is almost certainly git worktree.

Long

You have several wrong starting-point ideas, that you'll need to get rid of, before you can solve your basic problems here:

Git doesn't store changes in the first place.  Git stores commits.

Git therefore doesn't push changes either.  You push commits.

Commits don't go anywhere until you send them somewhere.

git stash itself makes commits; we'll see why in a moment.

You therefore need to know all about commits.  For much more about this, see, e.g., my answer here.  To cut to the chase, though, each commit's saved content is entirely read-only.  You literally can't work on a commit without first copying that commit out to a work area.

The files you're modifying, in other words, are not in Git at all.  They came out of Git earlier, and when you have them ready, you will put them back into Git.  But right now they're just ordinary files that aren't in Git.  Git can't save them if you wreck them, and that's why you—sometimes!—get:

error: Your local changes to the following files would be overwritten ...

It's because your files, in your working tree, will have to be destroyed (removed and replaced with other files) in order to switch to the other commit.  Git has checked, and what's in these files isn't what's saved forever in the commit.

Switching from one commit to another involves replacing files in your working tree—sometimes!  That's the source of the "sometimes" above.  If you're switching between two very different commits, most files will need to be replaced.  If you're switching between two very similar commits, only a few files will need to be replaced, and sometimes you'll be able to do it anyway (see Checkout another branch when there are uncommitted changes on the current branch).

Using git stash makes commits: this saves your work.  The commits that git stash makes are on no branch, which has two side effects that people find desirable:

You can't see these commits easily.

You can move the effect of these commits to some other branch easily.

It has other side effects that people find undesirable, including the fact that you can't see these commits easily.  That is, the first side effect is both boon and burden.

The long and short of it, though, is that if you wish to switch the current branch and therefore also the current commit in the (single) working tree, you must do something about / with any changes you have.  That thing you do can be any one of the following, or anything else you can think of:

leave them and hope;

stash them for later;

commit them—much the same as stashing, except now you can see the commits;

eradicate them entirely, with the intent of reproducing them later.

Multiple working trees

The key phrase above is:

switch the current branch and therefore also the current commit in the (single) working tree

Until Git version 2.5, Git only offered one working tree per clone.  So to get a second working tree, you had to clone again, or clone your clone (either method can work though cloning-again avoids the need to properly learn and understand references and refspecs).  Git 2.5 added git worktree, though, and Git 2.15 finally fixed a pretty nasty bug with git worktree.  So if your Git is at least 2.5, and preferably at least 2.15, you can use this method.  (If your Git is older, consider upgrading.)

With git worktree add, you tell Git: I'd like to add another working tree and corresponding index / staging-area to this repository.  You tell Git which branch should be checked out in this second working tree, and Git will check out that particular branch.  There is a constraint here: each branch in each added working tree can be used only in that one working tree.  (There is a good reason for this constraint; you can get around it by deleting the extra working trees, or changing the checked-out branches in them, but in general you should just work within the constraint until you're done.)

Since each added working tree is an added working tree, with its own index / staging-area, you can now simply cd into a different directory, and/or open an additional window or set of windows to work in/on the other branch.  Because they are separate, the two separate working trees won't interfere with each other unless you do something to make that happen.

See the git worktree documentation for further details.


问:
How do I run unit tests stored in my application directory as opposed to in the PHP directory?
I've just installed PHPUnit and wrote a quick class which I saved to C:\PHP and it worked fine.  If however I move the php file containing the test class to the tests directory of my application, it returns the error Class firstTest could not be found in ..

How do I resolve the problem such that it can see the class in the application test directory?

答: Check  your config file and ensure that the correct path to the tests dir is given.</p>

OwnerDisplayName: Iain

ContentLicense: CC BY-SA 3.0

OwnerDisplayName: Click Upvote

ContentLicense: CC BY-SA 2.5


问:
Problem with a C# csproj log file
I wish to write to output file like txt a log of done C# instruction during debuging my csproj. Is there any buildin function in VS2010 or any idea how to do this.</p>

答: Use System.Diagnostics.Trace class. This will write to the Output window (enable the Output window from Debug/Windows/Output).

Title: Problem with a C# csproj log file


问:
How to turn off (or on) sounds from Visual Studio Code?
I'd like to know how to turn off  sounds coming from VS Code. I'm running VSCode on Windows 10. I did a search in the settings:

and nothing showed up.

答:
This is because you possibly have accessibility Support enabled, so you just have to disable it.

...
"editor.accessibilitySupport": "off",
...
```


问:
GitHub Action: How to get value from expression evaluation and assign it to the environment variable
An environment expression is often assigned directly like the example below

```<code>  - name: set up env var
    env:
      TAG: v1.2.3
    run: echo $TAG
</code>```

But how can I get the value from shell script evaluation? For example in my terminal I can get the current Tag by git describe --exact-match --tags $(git log -n1 --pretty='%h')

but when I try to put this script into the env as follow

```<code>  - name: set up env var
    env:
      TAG: $(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
    run: echo $TAG
</code>```

the echo printed out $(git describe --exact-match --tags $(git log -n1 --pretty='%h')) which means it is not evaluated but treated as a string.

How can I get the value of git describe --exact-match --tags $(git log -n1 --pretty='%h') and assign it to the environment variable TAG ?

答:
You can add variables to the GITHUB_ENV by using: echo "{name}={value}" >> $GITHUB_ENV

This allows to create or update an environment variable for any actions running next in a job. The action that creates or updates the environment variable does not have access to the new value, but all subsequent actions in a job will have access. Environment variables are case-sensitive and you can include punctuation.

Source

So your workflow could for example look like this:

 - name: set up env var
    run: echo "TAG=$(echo git describe --exact-match --tags $(git log -n1 --pretty='%h'))" >> $GITHUB_ENV
 - name: use env var
    run: echo ${{ env.TAG }}
```

Body:
An environment expression is often assigned directly like the example below

  - name: set up env var
    env:
      TAG: v1.2.3
    run: echo $TAG

But how can I get the value from shell script evaluation? For example in my terminal I can get the current Tag by git describe --exact-match --tags $(git log -n1 --pretty='%h')

but when I try to put this script into the env as follow

  - name: set up env var
    env:
      TAG: $(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
    run: echo $TAG

the echo printed out $(git describe --exact-match --tags $(git log -n1 --pretty='%h')) which means it is not evaluated but treated as a string.

How can I get the value of git describe --exact-match --tags $(git log -n1 --pretty='%h') and assign it to the environment variable TAG ?


问:
Get user input typed in adaptive card c# and reply with details
I have created an adaptive card for my bot to pass to users if it can't find anything they are looking for.

The thing is i'm not sure how to get the Submit button in the adaptive card to collect information. At some point i want to get it to send an email but for now i just need to figure out how to collect the user input and display that input back to them

Here is the code i have i c#

```<code>await turnContext.SendActivityAsync(MessageFactory.Text("Sorry, I couldn't find what your looking for."), cancellationToken);
      if (turnContext.Activity.Text != ("Sorry, I couldn't find what your looking for."))
      {
        var reply = MessageFactory.Attachment(new Attachment { ContentType = AdaptiveCard.ContentType, Content = AdaptiveCard.FromJson(File.ReadAllText("CaseAdaptivecard.json")).Card }); //pass adaptive card to content
</code>```

here is the adaptive card Json file

```<code>{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.2",
    "body": [
        {
            "type": "Image",
            "size": "stretch",
            "horizontalAlignment": "center"
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 2,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "Details of issues",
                            "weight": "Bolder",
                            "size": "Medium"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Please let me know the issues your having and i'll pass this to my creators :)",
                            "isSubtle": true,
                            "wrap": true
                        },
                        {
                            "type": "Container",
                            "$data": "${properties}",
                            "items": [

                                {
                                    "type": "Input.Text",
                                    "id": "Email.Block",
                                    "label": "Email"
                                },
                                    {
                                        "type": "Input.Text",
                                        "id": "Subject.Block",
                                        "label": "Subject"
                                    }

                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "Input.Text",
            "id": "Description.Block",
            "label": "Description"
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit",
            "data": {
                "prop1": true,
                "prop2": []}
        }

    ]
}
</code>```

答:
When the user clicks submit, that sends an actvity back to the bot. Simply, it might look something like:

{
  "channelData": {
  },
  "type": "message",
  "value": {
    "prop1": true,
    "prop2": [],
    "Email.Block": "email",
    "Subject.Block": "sub",
    "Description.Block": "desc"
  },
  "channelId": "emulator",
  "from": {
    "name": "User",
  },
  "recipient": {
    "name": "Bot",
  }
}
```
<p>This does not have the typical 'text' value that would exist a normal message to the bot like this:</p>
<pre class="lang-json prettyprint-override"><code>{
  "channelData": {
  },
  "text": "Hello there bot!",
  "textFormat": "plain",
  "type": "message",
  "channelId": "emulator",
  "from": {
    "name": "User",
  },
  "recipient": {
    "name": "Bot",
  }
}
</code>```

But you can see that it does have the submitted values back in the 'value' property.

These are both of type message, so you just need to handle checking for those properties (turnContext.Activity.Value) in your OnMessageActivityAsync handler.

Body:
I have created an adaptive card for my bot to pass to users if it can't find anything they are looking for.

The thing is i'm not sure how to get the Submit button in the adaptive card to collect information. At some point i want to get it to send an email but for now i just need to figure out how to collect the user input and display that input back to them

Here is the code i have i c#

await turnContext.SendActivityAsync(MessageFactory.Text("Sorry, I couldn't find what your looking for."), cancellationToken);
      if (turnContext.Activity.Text != ("Sorry, I couldn't find what your looking for."))
      {
        var reply = MessageFactory.Attachment(new Attachment { ContentType = AdaptiveCard.ContentType, Content = AdaptiveCard.FromJson(File.ReadAllText("CaseAdaptivecard.json")).Card }); //pass adaptive card to content

here is the adaptive card Json file

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.2",
    "body": [
        {
            "type": "Image",
            "size": "stretch",
            "horizontalAlignment": "center"
        },
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 2,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "Details of issues",
                            "weight": "Bolder",
                            "size": "Medium"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Please let me know the issues your having and i'll pass this to my creators :)",
                            "isSubtle": true,
                            "wrap": true
                        },
                        {
                            "type": "Container",
                            "$data": "${properties}",
                            "items": [

                                {
                                    "type": "Input.Text",
                                    "id": "Email.Block",
                                    "label": "Email"
                                },
                                    {
                                        "type": "Input.Text",
                                        "id": "Subject.Block",
                                        "label": "Subject"
                                    }

                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "Input.Text",
            "id": "Description.Block",
            "label": "Description"
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit",
            "data": {
                "prop1": true,
                "prop2": []}
        }

    ]
}

Body:
When the user clicks submit, that sends an actvity back to the bot. Simply, it might look something like:

{
  "channelData": {
  },
  "type": "message",
  "value": {
    "prop1": true,
    "prop2": [],
    "Email.Block": "email",
    "Subject.Block": "sub",
    "Description.Block": "desc"
  },
  "channelId": "emulator",
  "from": {
    "name": "User",
  },
  "recipient": {
    "name": "Bot",
  }
}

This does not have the typical 'text' value that would exist a normal message to the bot like this:

{
  "channelData": {
  },
  "text": "Hello there bot!",
  "textFormat": "plain",
  "type": "message",
  "channelId": "emulator",
  "from": {
    "name": "User",
  },
  "recipient": {
    "name": "Bot",
  }
}

But you can see that it does have the submitted values back in the 'value' property.

These are both of type message, so you just need to handle checking for those properties (turnContext.Activity.Value) in your OnMessageActivityAsync handler.


问:
Not able to use locally built provider in terraform docker image
I have built locally a google terraform provider for adding schema support. When I simply use the binaries with normal Terraform installation on wsl2 and setting up the configs like .terraformrc the provider binaries can be used without any issue.

Although when I try to use the binaries in a terraform docker image (copied the binaries under /go/bin/providers) even though Terraform says it has been successfully initialized it fails with no such files or directory message.

```<code>Terraform has been successfully initialized!

 You may now begin working with Terraform. Try running "terraform plan" to see
 any changes that are required for your infrastructure. All Terraform commands
 should now work.

 If you ever set or change modules or backend configuration for Terraform,
 rerun this command to reinitialize your working directory. If you forget, other
 commands will detect it and remind you to do so if necessary.

 Error: Could not load plugin

 Plugin reinitialization required. Please run "terraform init".

 Plugins are external binaries that Terraform uses to access and manipulate
 resources. The configuration provided requires plugins which can't be
 located,
 don't satisfy the version constraints, or are otherwise incompatible.

 Terraform automatically discovers provider requirements from your
 configuration, including providers used in child modules. To see the
 requirements and constraints, run "terraform providers".

 2 problems:

 - failed to instantiate provider "registry.terraform.io/hashicorp/google"
 to obtain schema: fork/exec
 .terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64/terraform-provider-google_v3.58.0_x5:
 no such file or directory
 - failed to instantiate provider
 "registry.terraform.io/hashicorp/google-beta" to obtain schema: fork/exec
 .terraform/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64/terraform-provider-google-beta_v3.64.0_x5:
 no such file or directory
</code>```

The binaries are exists under the right folder:

```<code>/go/bin/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64:
total 79768
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 .
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 ..
-rwxrwxrwx    1 root     root      81661207 Apr 29 21:41 terraform-provider-google-beta_v3.64.0_x5

/go/bin/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64:
total 77320
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 .
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 ..
-rwxrwxrwx    1 root     root      79157279 Apr 29 21:42 terraform-provider-google_v3.58.0_x5
</code>```

The symlink is created during init and points to the right target. Permissions granted.

```<code>/terraform/.terraform/providers/registry.terraform.io/hashicorp/google-beta/3.64.0:
 total 12
 drwxr-xr-x    2 root     root          4096 Apr 29 21:59 .
 drwxr-xr-x    3 root     root          4096 Apr 29 21:59 ..
 lrwxrwxrwx    1 root     root            80 Apr 29 21:59 linux_amd64 -> /go/bin/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64
   File: '/terraform/.terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64' -> '/go/bin/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64'
   Size: 75         Blocks: 8          IO Block: 4096   symbolic link
 Device: 810h/2064d Inode: 1460422     Links: 1
 Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
 Access: 2021-05-04 12:07:48.516825600 +0000
 Modify: 2021-04-29 21:59:20.960000000 +0000
 Change: 2021-04-29 21:59:20.960000000 +0000
   File: /terraform/.terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64/terraform-provider-google_v3.58.0_x5
   Size: 79157279   Blocks: 154608     IO Block: 4096   regular file
 Device: 2dh/45d    Inode: 1460171     Links: 1
 Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
 Access: 2021-05-04 12:09:45.596825600 +0000
 Modify: 2021-04-29 21:42:44.000000000 +0000
 Change: 2021-05-04 12:09:45.556825600 +0000
</code>```

CLI config file has the right path:

```<code>disable_checkpoint = true

provider_installation {
  filesystem_mirror {
    path    = "/go/bin/providers"
    include = ["*/*/*"]
  }
}
</code>```

Seemingly it should work with the docker image as it does on the local installation but it isn't working.

Can someone point me to the direction what am I missing from the configuration to get the binaries work with the terraform docker image?

Many thanks,
Gabesz

答: Try building with CGO_ENABLED=0

Body:
I have built locally a google terraform provider for adding schema support. When I simply use the binaries with normal Terraform installation on wsl2 and setting up the configs like .terraformrc the provider binaries can be used without any issue.

Although when I try to use the binaries in a terraform docker image (copied the binaries under /go/bin/providers) even though Terraform says it has been successfully initialized it fails with no such files or directory message.

Terraform has been successfully initialized!

 You may now begin working with Terraform. Try running "terraform plan" to see
 any changes that are required for your infrastructure. All Terraform commands
 should now work.

 If you ever set or change modules or backend configuration for Terraform,
 rerun this command to reinitialize your working directory. If you forget, other
 commands will detect it and remind you to do so if necessary.

 Error: Could not load plugin

 Plugin reinitialization required. Please run "terraform init".

 Plugins are external binaries that Terraform uses to access and manipulate
 resources. The configuration provided requires plugins which can't be
 located,
 don't satisfy the version constraints, or are otherwise incompatible.

 Terraform automatically discovers provider requirements from your
 configuration, including providers used in child modules. To see the
 requirements and constraints, run "terraform providers".

 2 problems:

 - failed to instantiate provider "registry.terraform.io/hashicorp/google"
 to obtain schema: fork/exec
 .terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64/terraform-provider-google_v3.58.0_x5:
 no such file or directory
 - failed to instantiate provider
 "registry.terraform.io/hashicorp/google-beta" to obtain schema: fork/exec
 .terraform/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64/terraform-provider-google-beta_v3.64.0_x5:
 no such file or directory

The binaries are exists under the right folder:

/go/bin/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64:
total 79768
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 .
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 ..
-rwxrwxrwx    1 root     root      81661207 Apr 29 21:41 terraform-provider-google-beta_v3.64.0_x5

/go/bin/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64:
total 77320
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 .
drwxrwxrwx    1 root     root          4096 Apr 29 21:43 ..
-rwxrwxrwx    1 root     root      79157279 Apr 29 21:42 terraform-provider-google_v3.58.0_x5

The symlink is created during init and points to the right target. Permissions granted.

/terraform/.terraform/providers/registry.terraform.io/hashicorp/google-beta/3.64.0:
 total 12
 drwxr-xr-x    2 root     root          4096 Apr 29 21:59 .
 drwxr-xr-x    3 root     root          4096 Apr 29 21:59 ..
 lrwxrwxrwx    1 root     root            80 Apr 29 21:59 linux_amd64 -> /go/bin/providers/registry.terraform.io/hashicorp/google-beta/3.64.0/linux_amd64
   File: '/terraform/.terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64' -> '/go/bin/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64'
   Size: 75         Blocks: 8          IO Block: 4096   symbolic link
 Device: 810h/2064d Inode: 1460422     Links: 1
 Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
 Access: 2021-05-04 12:07:48.516825600 +0000
 Modify: 2021-04-29 21:59:20.960000000 +0000
 Change: 2021-04-29 21:59:20.960000000 +0000
   File: /terraform/.terraform/providers/registry.terraform.io/hashicorp/google/3.58.0/linux_amd64/terraform-provider-google_v3.58.0_x5
   Size: 79157279   Blocks: 154608     IO Block: 4096   regular file
 Device: 2dh/45d    Inode: 1460171     Links: 1
 Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
 Access: 2021-05-04 12:09:45.596825600 +0000
 Modify: 2021-04-29 21:42:44.000000000 +0000
 Change: 2021-05-04 12:09:45.556825600 +0000

CLI config file has the right path:

disable_checkpoint = true

provider_installation {
  filesystem_mirror {
    path    = "/go/bin/providers"
    include = ["*/*/*"]
  }
}

Seemingly it should work with the docker image as it does on the local installation but it isn't working.

Can someone point me to the direction what am I missing from the configuration to get the binaries work with the terraform docker image?

Many thanks,
Gabesz

Body: Try building with CGO_ENABLED=0


问:
how to use '\n' within text property of mx:TextArea in flex 4?
As per my observation this does not work in flex4:

```<code><mx:TextArea id="taMytext" text="\n hi\n san"/> //use of \n does not work here
<s:Button label="Click it" click="Myfun()" />
</code>```

Using script it's possible:

```<code>public function Myfun():void
            {
                taMytext.text="hi\n";
                taMytext.text+="san";
            }
</code>```

答:
It seems the only way is to use the following:</p>

```<code><mx:TextArea horizontalCenter="0" id="taMytext" text="{'\n'} hi{'\n'} san" verticalCenter="0" />
</code>```

Body:
As per my observation this does not work in flex4:

<mx:TextArea id="taMytext" text="\n hi\n san"/> //use of \n does not work here
<s:Button label="Click it" click="Myfun()" />

Using script it's possible:

public function Myfun():void
            {
                taMytext.text="hi\n";
                taMytext.text+="san";
            }

Body:
It seems the only way is to use the following:

<mx:TextArea horizontalCenter="0" id="taMytext" text="{'\n'} hi{'\n'} san" verticalCenter="0" />


问:
Google Drive API v3 Permissions sendNotificationEmail: False -Not Working
I am utilizing the Permissions endpoint call of the Google Drive API v3 to assign reader and writer status to a folder within app scripts for a shared google drive. The main goal is to not send the notification email when the permission is shared with a user. I have included the parameter 'sendNotificationEmail: false' in the body of the request however the email is still being sent notifying the user. The code snippet that I am using is below. Am I including the 'sendNotificationEmail' parameter in the wrong part of the request?

if (currTabName == "Testing" && curRange.getColumn() == 2){
   for (var i = row; i < (row+rows); i++) {
     var Email = currSS.getRange(i,2,1,1).getValue();
     try{
      var url = 'https://www.googleapis.com/drive/v3/files/FileID/permissions';
      var data = {
        'role': 'writer',
        'type': 'user',
        'sendNotificationEmail': false,
        'emailAddress': Email,
        'supportsAllDrives': true,
      }
      var options = {
        'method'     : 'POST',
        'contentType': 'application/json',
        'headers'    : { Authorization: 'Bearer ' + 'yourAccessToken' },
        'payload'    : JSON.stringify(data) // Convert JavaScript object to JSON string
      };
      var response = UrlFetchApp.fetch(url, options);
      Logger.log(response);
     }
     catch(err) {
       Logger.log(err.message);```

答:
At the method of Permissions: create of Drive API, sendNotificationEmail and supportsAllDrives are required to be included in the query parameter. I think that this is the reason for your issue. So how about the following modification?

From:

```<code>var url = 'https://www.googleapis.com/drive/v3/files/folderthatstatusisgrantedfor/permissions';
var data = {
  'role': 'writer',
  'type': 'user',
  'sendNotificationEmail': false,
  'emailAddress': Email,
  'supportsAllDrives': true,
}
var options = {
  'method'     : 'POST',
  'contentType': 'application/json',
  'headers'    : { Authorization: 'Bearer ' + 'yourAccessToken' },
  'payload'    : JSON.stringify(data) // Convert JavaScript object to JSON string
};
var response = UrlFetchApp.fetch(url, options);
</code>```

To:

```<code>var folderId = "###"; // Please set the folder ID.

var url = `https://www.googleapis.com/drive/v3/files/${folderId}/permissions`;
url += "?sendNotificationEmail=false&supportsAllDrives=true";
var data = {
  'role': 'writer',
  'type': 'user',
  'emailAddress': Email,
}
var options = {
  'method': 'POST',
  'contentType': 'application/json',
  'headers': { Authorization: 'Bearer ' + 'yourAccessToken' },
  'payload': JSON.stringify(data)
};
var response = UrlFetchApp.fetch(url, options);
</code>```

Reference:

Permissions: create

Body:
At the method of Permissions: create of Drive API, sendNotificationEmail and supportsAllDrives are required to be included in the query parameter. I think that this is the reason for your issue. So how about the following modification?

From:

var url = 'https://www.googleapis.com/drive/v3/files/folderthatstatusisgrantedfor/permissions';
var data = {
  'role': 'writer',
  'type': 'user',
  'sendNotificationEmail': false,
  'emailAddress': Email,
  'supportsAllDrives': true,
}
var options = {
  'method'     : 'POST',
  'contentType': 'application/json',
  'headers'    : { Authorization: 'Bearer ' + 'yourAccessToken' },
  'payload'    : JSON.stringify(data) // Convert JavaScript object to JSON string
};
var response = UrlFetchApp.fetch(url, options);

To:

var folderId = "###"; // Please set the folder ID.

var url = `https://www.googleapis.com/drive/v3/files/${folderId}/permissions`;
url += "?sendNotificationEmail=false&supportsAllDrives=true";
var data = {
  'role': 'writer',
  'type': 'user',
  'emailAddress': Email,
}
var options = {
  'method': 'POST',
  'contentType': 'application/json',
  'headers': { Authorization: 'Bearer ' + 'yourAccessToken' },
  'payload': JSON.stringify(data)
};
var response = UrlFetchApp.fetch(url, options);

Reference:

Permissions: create


问:
File-loader creating 2 images and linking the wrong one
file-loader is creating two separate images in my build folder. One is the named correctly and saved in the correct path, the other is named [hash].png (which is the default) and is stored in build, not build/images. The second incorrect file is 0 bytes; this is the one being linked in the final index.html file in the build folder. I've defined both outputPath and publicPath. publicPath doesn't seem to actually do anything though, regardless of what I put there. Am I misunderstanding what it does?

```<code>module.exports = {
    entry: {
        index: './app/main.js',
        vendor: './app/vendor.js'
    },
    output: {
        path: path.resolve(__dirname, './build'),
        filename: '[name].[contenthash].js',
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: [/node_modules/, /api/, /tests/, /coverage/],
                use: 'babel-loader'
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            },
            {
                test: /\.html$/,
                use: 'html-loader'
            },
            {
                test: /\.(svg|png|jpg|gif)$/,
                use:{
                    loader: 'file-loader',
                    options: {
                        name: '[name].[hash].[ext]',
                        outputPath: 'images/',
                        publicPath: 'images/'
                    }
                }
            },
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({ template: './app/index.html' }),
        new CleanWebpackPlugin()
    ]
};
</code>```

Image link in final html:

```<code><img src="465107fe07e3ec18a463.png">
</code>```

Another post with the same issue that didn't get any answers:
Webpack, I am trying to use file loader to load images but whenever i run build i get 2 images not 1 and the one linking to the html file is wrong

答:
```<code>        {
            test: /\.(png|svg|jpg|jpeg|gif)$/i,
            type: 'asset/resource',
        },
</code>```

Body:
file-loader is creating two separate images in my build folder. One is the named correctly and saved in the correct path, the other is named [hash].png (which is the default) and is stored in build, not build/images. The second incorrect file is 0 bytes; this is the one being linked in the final index.html file in the build folder. I've defined both outputPath and publicPath. publicPath doesn't seem to actually do anything though, regardless of what I put there. Am I misunderstanding what it does?

module.exports = {
    entry: {
        index: './app/main.js',
        vendor: './app/vendor.js'
    },
    output: {
        path: path.resolve(__dirname, './build'),
        filename: '[name].[contenthash].js',
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: [/node_modules/, /api/, /tests/, /coverage/],
                use: 'babel-loader'
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            },
            {
                test: /\.html$/,
                use: 'html-loader'
            },
            {
                test: /\.(svg|png|jpg|gif)$/,
                use:{
                    loader: 'file-loader',
                    options: {
                        name: '[name].[hash].[ext]',
                        outputPath: 'images/',
                        publicPath: 'images/'
                    }
                }
            },
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({ template: './app/index.html' }),
        new CleanWebpackPlugin()
    ]
};

Image link in final html:

Another post with the same issue that didn't get any answers:
Webpack, I am trying to use file loader to load images but whenever i run build i get 2 images not 1 and the one linking to the html file is wrong


问:
How to parse lines after a certain text in python
I am trying to parse a text file. I need certain line of it only. I need to search for "tool> exit"
and parse all lines after that until 2nd last line. Here is the text I am trying to parse -

```<code>complete
line:567       finish;
tool> exit
  Finish Failed  Myname
       0      0   ABC_dog_ctl
       5      1   ABC_cator_t
      34      0   ABC_cator_t
       0      0   ABC_cator_t
  Total = 12,  Failing = 4
  summary at 70s
TOOL:   mytool
</code>```

I am trying to parse only -

```<code>  Finish Failed  Myname
       0      0   ABC_dog_ctl
       5      1   ABC_cator_t
      34      0   ABC_cator_t
       0      0   ABC_cator_t
  Total = 12,  Failing = 4
  summary at 70s
</code>```

I am trying something like -

```<code>my_list = []
for line_no, line in enumerate(Infile):
    if "tool> exit" in line:
        start_line = line_no
        my_list.append[line+1]

</code>```

But I am not getting desired result. There are multiple instances of "TOOL" so I can't search it, but it's the last line so I think I can look for line above it always.

答:
Something like this?

```<code>my_list = []
reached_tool_exit = False
for line in Infile:
  if "tool> exit" in line:
    reached_tool_exit = True
  if reached_tool_exit:
    my_list.append(line)
my_list = my_list[:-1]
</code>```

Edit:

Actually, you should use del my_list[-1] instead of my_list = my_list[:-1]. That's more efficient.

Body:
I am trying to parse a text file. I need certain line of it only. I need to search for "tool> exit"
and parse all lines after that until 2nd last line. Here is the text I am trying to parse -

complete
line:567       finish;
tool> exit
  Finish Failed  Myname
       0      0   ABC_dog_ctl
       5      1   ABC_cator_t
      34      0   ABC_cator_t
       0      0   ABC_cator_t
  Total = 12,  Failing = 4
  summary at 70s
TOOL:   mytool

I am trying to parse only -

  Finish Failed  Myname
       0      0   ABC_dog_ctl
       5      1   ABC_cator_t
      34      0   ABC_cator_t
       0      0   ABC_cator_t
  Total = 12,  Failing = 4
  summary at 70s

I am trying something like -

my_list = []
for line_no, line in enumerate(Infile):
    if "tool> exit" in line:
        start_line = line_no
        my_list.append[line+1]

But I am not getting desired result. There are multiple instances of "TOOL" so I can't search it, but it's the last line so I think I can look for line above it always.

Body:
Something like this?

my_list = []
reached_tool_exit = False
for line in Infile:
  if "tool> exit" in line:
    reached_tool_exit = True
  if reached_tool_exit:
    my_list.append(line)
my_list = my_list[:-1]

Edit:

Actually, you should use del my_list[-1] instead of my_list = my_list[:-1]. That's more efficient.