Advice on improving Gremlin query performance for embedded DB

Hi,

I am part of a team that is building a desktop Java app that uses an embedded Orient DB. We are using OrientDB v3.0.22 and Gremlin v3.4.0.

We are trying to improve a complex Gremlin query that is filtering on a grandparent vertex property.

Is it possible to create indices that can improve the performance of traversals to grandparent vertices?

What would be the best way for me to share our current Schema and the performance issues of the current query?

Running the Gremlin profile() method returns the following:

Traversal Metrics
Step                                                               Count  Traversers       Time (ms)    % Dur
=============================================================================================================
OrientGraphStep(vertex,[~label.eq(VisitV)])@[vi...                  1430        1430           6,123     0,17
VertexStep(IN,[URL_VisitE],vertex)                                  1434        1434          14,439     0,39
HasStep([isIgnored.eq(false)])                                      1434        1434           3,321     0,09
TraversalFilterStep([VertexStep(IN,[URLType_URL...                  1110        1110          93,077     2,51
  VertexStep(IN,[URLType_URLE],vertex)                              1110        1110          22,680
  HasStep([isIgnored.eq(false)])                                    1110        1110          14,943
  NotStep([VertexStep(IN,[EntityType_EntityType...                                            53,926
    VertexStep(IN,[EntityType_EntityTypeE],edge)                                              40,565
SelectOneStep(last,visit)                                           1110        1110           1,900     0,05
NoOpBarrierStep(2500)                                               1110        1107           0,890     0,02
VertexStep(OUT,[Visit_EntityE],vertex)                             73510       73473         357,917     9,66
NoOpBarrierStep(2500)                                              73510       60165          34,957     0,94
HasStep([isIgnored.eq(false)])                                     63213       60140         141,988     3,83
TraversalFilterStep([VertexStep(IN,[EntityType_...                 30567       27859        2941,098    79,37
  VertexStep(IN,[EntityType_EntityE],vertex)                       62697       62697        1605,033
  HasStep([~id.eq(#101:2)])                                                                 1284,226
DedupGlobalStep                                                    20743       20743          13,861     0,37
DedupGlobalStep                                                    20743       20743           9,309     0,25
OrderGlobalStep([[[CoalesceStep([[PropertiesSte...                    41          41          81,576     2,20
  CoalesceStep([[PropertiesStep([typeCnt],value...                 20743       20743          52,157
    PropertiesStep([typeCnt],value)                                20743       20743          38,964
RangeGlobalStep(0,40)                                                 40          40           0,118     0,00
ProjectStep([vertex, type, tags],[identity, [Ve...                    40          40           4,831     0,13
  VertexStep(IN,[EntityType_EntityE],vertex)                          40          40           0,280
  NotStep([VertexStep(OUT,[EntityType_EntityTyp...                    40          40           1,514
    VertexStep(OUT,[EntityType_EntityTypeE],ver...                                             1,469
  VertexStep(OUT,[Entity_TagE],vertex)                                                         1,483
  IdStep                                                                                       1,323
  FoldStep                                                            40          40           0,029
                                            >TOTAL                     -           -        3705,412        -