**Why to I asked this question?**

I have a table which as key that have a lot of field. Every time, I'm making a jointure, I miss a field. Therefore I have defined a pipelined function that take the key as an argument so that I am sure that I get only one element when I'm doing a jointure.
But the query take more time now. The table a has an index on some fields but not the table type used by pipelined function. I would like to know if it is possible to created a index on some fields of the table%rowtype

code:

```
create table a ( a1 integer);

create package p_a
as
   type t_a iS TABLE of a%ROWTYPE;

   function f(i_a1 integer) return t_a pipelined;
end;

CREATE PACKAGE BODY p_a
AS
    CURSOR c_A (i_a1 INTEGER)
        RETURN a%ROWTYPE
    IS
        SELECT t.*
          FROM a t
         WHERE t.a1 = i_a1;

    FUNCTION f (i_a1 INTEGER)
        RETURN t_a
        PIPELINED
    IS
    BEGIN
        FOR c IN c_a (i_a1)
        LOOP
            PIPE ROW (c);
        END LOOP;
    END;
END;

with b as( select 1 b1 from dual) select * from b cross apply (table(p_a.f(b.b1)));

```

**the question**

I've tried to index the type table by a field of a table like this

```
create table a ( a1 integer);

create package p_a2
as
   type t_a iS TABLE of a%ROWTYPE index by a.a1%type;

   function f(i_a1 integer) return t_a pipelined;
end;

```

> 
> PLS-00315: Implementation restriction: unsupported table index type
> 
> 
> 

Is what I want to do possible. If not how to solve the performance problems mentioned in the introduction?

[code](https://dbfiddle.uk/?rdbms=oracle_21&fiddle=1402c249cf944b5fbf7deec41a56ac0c)