Fastest way to search in a dataitem

Hello.
Can you tell me, what is the fastest way to search for a specific dataitem value.
Lets say I have invoices and invoice positions in a dataitem and want to find all invoiceppositions for invoice xy?
Should I use filters or queries?
Or is any of the possibilites as fast as the other?

Thanks.

Hello,

I’d use a Query with a Filter as in the Speed example:

procedure TBISpeedTest.SQL1_Proc;
var Query : TDataSelect;
    Alex : TDataItem;
begin
  Query:=TDataSelect.Create(nil);
  try
    Query.Add(Persons); // * all fields

    Query.Filter:=TDataFilter.FromString(Persons,'Name="Alex"');

    // Execute Query and after that, just destroy results
    Alex:=Query.Calculate;
    Alex.Free;

  finally
    Query.Free;
  end;
end;

Ok.
Thanks Yeray.