You're looking up Occupation.id, so an index there would be needed. The rule of the thumb is: create indexes to speedup lookups, like you would do with a RDBMS.
Lvc@ On 23 March 2015 at 16:45, Gianpaolo Altamura <[email protected]> wrote: > Hi Luca, > thank you for your repl I have created indexes against Movies.id and > Users.id: > > User.json > > { > "config": { > "log": "info", > "parallel": false > }, > "source": { > "file": { > "path": "D:\\ETL\\users.dat" > } > }, > "extractor": { > "row": { > } > }, > "transformers": [{ > "csv": { > "separator": "^", > "columnsOnFirstLine": false, > "columns": ["id", > "gender:string", > "age:integer", > "occupationId:integer", > "zipCode:string"] > } > }, > { > "vertex": { > "class": "Users" > } > }, > { > "edge": { > "class": "hasOccupation", > "joinFieldName": "occupationId", > "lookup": "Occupation.id", > "unresolvedLinkAction": "CREATE" > } > } > ], > "loader": { > "orientdb": { > "dbURL": "remote:localhost/MovieRatings", > "dbType": "graph", > "standardElementConstraints": false, > "classes": [{ > "name": "Users", > "extends": "V" > }, > { > "name": "hasOccupation", > "extends": "E" > }], > "indexes": [{ > "class": "Users", > "fields": ["id:integer"], > "type": "UNIQUE" > }] > } > } > } > > > Movies.json > > { > "config": { > "log": "info", > "parallel": false > }, > "source": { > "file": { > "path": "D:\\ETL\\movies.dat" > } > }, > "extractor": { > "row": { > } > }, > "transformers": [{ > "csv": { > "separator": "^", > "columnsOnFirstLine": false, > "columns": ["id", > "title:string", > "genres"] > } > }, > { > "field": { > "fieldName": "genresArray", > "expression": "split(genres,'|')" > } > }, > { > "field": { > "fieldName": "genresArray_0", > "expression": "genresArray[0]" > } > }, > { > "field": { > "fieldName": "genresArray_1", > "expression": "genresArray[1]" > } > }, > { > "field": { > "fieldName": "genresArray_2", > "expression": "genresArray[2]" > } > }, > { > "field": { > "fieldName": "genresArray_3", > "expression": "genresArray[3]" > } > }, > { > "field": { > "fieldName": "genresArray_4", > "expression": "genresArray[4]" > } > }, > { > "field": { > "fieldName": "genresArray_5", > "expression": "genresArray[5]" > } > }, > { > "vertex": { > "class": "Movies" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_0", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_1", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_2", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_3", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_4", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }, > { > "edge": { > "class": "hasGenera", > "joinFieldName": "genresArray_5", > "lookup": "Genres.description", > "unresolvedLinkAction": "CREATE" > } > }], > "loader": { > "orientdb": { > "dbURL": "remote:localhost/MovieRatings", > "dbType": "graph", > "standardElementConstraints": false, > "classes": [{ > "name": "Movies", > "extends": "V" > }, > { > "name": "Genres", > "extends": "V" > }, > { > "name": "hasGenera", > "extends": "E" > }], > "indexes": [{ > "class": "Movies", > "fields": ["id:integer"], > "type": "UNIQUE" > }, > { > "class": "Genres", > "fields": ["description:string"], > "type": "UNIQUE_HASH_INDEX" > }] > } > } > } > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
