Comments (10)
Hello have you tried the neomodel create method?, it's built into the StructuredNode class. It won't be quite as fast as the batch-import program but it does group the rest requests into a single batch operation so it will be faster than looping over the dataset also it handles indexing which batch-import doesnt.
people = Person.create(
{'name': 'Bob', 'age': 23},
{'name': 'Tim', 'age': 44}
)
from neomodel.
Also I would like add, that batches over the REST interface aren't
supposed to be very huge. You might start trying with appr 500 per batch
and see if the performance is good enough.
from neomodel.
From previous experimentation, I've found a batch size of about 300 per
batch gives optimum performance. Although that may be only with my setup
and not a general rule.
On 5 July 2013 10:33, Kristian Kankainen [email protected] wrote:
Also I would like add, that batches over the REST interface aren't
supposed to be very huge. You might start trying with appr 500 per batch
and see if the performance is good enough.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-20509114
.
from neomodel.
Thanks I've updated the docs :-)
from neomodel.
Hey !!!
You were absolutely right, now the import is at least 10x-15x faster using a batch size of 280-320 properties.
I have a doubt, when you refer to batch size is the number of properties and relationships, right ? or the number of nodes?
Thank you,
from neomodel.
The number comes from the number of actions taken within a batch. In this
context, it would be the number of entities created, both nodes and
relationships.
On 5 Jul 2013 18:04, "Sebastian Ortiz" [email protected] wrote:
Hey !!!
You were absolutely right, now the import is at least 10x-15x faster using
a batch size of 280-320 properties.I have a doubt, when you refer to batch size is the number of properties
and relationships, right ? or the number of nodes?Thank you,
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-20529088
.
from neomodel.
Thank you, now i have another doubt, the create method is like this
@classmethod
def create(cls, *props)
...
And with the example on this issue, @robinedwards i dont know how to call the create method with a list of dicts containing the data, something like
header = map(lambda f: f.strip('\n').strip('"').lower(), line.split('|'))
batchList = []
batchSize = 300
for line in ins:
fields = map(lambda f: f.strip('\n').strip('"'),
line.replace(',', '.').split('|'))
record = {}
map(lambda k, v: record.update({k: v}), header, fields)
batchList.append(record)
if len(batchList) == batchSize:
#: this will fail
RegistroPredioCatastroTipo2.create(batchList)
batchList = []
RegistroPredioCatastroTipo2.create(batchList)
from neomodel.
When you call create it's expecting a list of dicts as opposed to a reference to a list.
Try this:
RegistroPredioCatastroTipo2.create(*batchList)
from neomodel.
Thank you @robinedwards , today i will try to do the batch import test with the recomendations on this issue.
from neomodel.
Awesome !!!
Thank you for your help, using this method the performance on insert is acceptable for our requeriments, i am inserting about 2000 nodes with 30 properties per second.
Thank you again!
from neomodel.
Related Issues (20)
- Use of batch create_or_update raises Exception HOT 2
- Discussion : Do we want to add Property type constraints ?
- Database introspection HOT 1
- Support for Vector indexes HOT 2
- Autocomplete not recognizing parameters of an instance of "StructuredNode". HOT 1
- Failed creating nodes to neo4j aura HOT 1
- Db version parsing in Aura
- Provide "light" options for inspection script HOT 1
- Incorrect query for count of objects HOT 2
- AttributeError: 'SpecificNode' object has no attribute 'unique_relation' HOT 2
- Relationship properties marked with db_property are skipped during inflation HOT 1
- Structured Node `__eq__` works incorrectly for non-persisted nodes.
- Unable to access property values on nodes that inherit from SemiStructuredNode HOT 1
- neomodel_inspect_database - Only writes first relationship HOT 2
- Missing import in contrib __init__ HOT 1
- Neomodel trying to connect to localhost, even if the database is on Aura ( When calling NODE_NAME.nodes.all() ) HOT 2
- `UniqueIdProperty` makes `get_or_create()` function does not work as expected HOT 2
- zero or more relationships in either direction of type RELATIONSHIP_NAME on node (4:2c06737f-f675-4209-a253-42d649d5fc59:395) of class 'NODE_LABEL'
- `Database` was removed from `neomodel.util` and moved into `neomodel.sync_.core` HOT 4
- Cant retrieve additional relations using `fetch_relations` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neomodel.