Retired: Changing your Garbage Collection Method to G1

This is already the default Garbage Collector in Neo4j 2.3+. This guide is only intended for previous versions. When to Use G1: By default, Neo4j versions 2.2 and earlier use Concurrent Mark and Sweep (CMS) for garbage collection. Customers with… Read more →

How do I set a breakpoint in a Cypher statement for further analysis

If you wish to set a ‘breakpoint’ in a Cypher statement so as to perform further analysis (i.e. see how many locks are taken, memory utilization) one can add a call to apoc.utils.sleep(XXX) which will result in the query sleeping… Read more →

java.lang.OutOfMemoryError: unable to create new native thread

When a client application establishes a session with a Neo4j server via the bolt or bolt+routing protocols, the server allocates a thread to serve as the server-side bolt worker to handle that connection. There is no server-side limitation on the… Read more →

How do I pass parameters when calling apoc.cypher.runFile

APOC allows one to have a stored procedure, apoc.cypher.runFile, to then run the contents of the file to the Cypher engine. To allow the reading of the file in the conf/neo4j.conf one needs to define apoc.import.file.enabled=true and then if one… Read more →

How do I log parameter values into the query.log file

Neo4j 3.0 introduces the ability to log the value of query parameters in the log/query.log file. The settings to control this feature are located in the conf/neo4j.conf file. To enable query logging with parameters, one must first enable query logging… Read more →

Understanding Neo4j’s data on disk

Neo4j database files are persisted to storage for long term durability. Data related files located in data/databases/graph.db (v3.x+) by default in the Neo4j data directory. Below will give you an idea of the type of files you’ll find, prefaced with… Read more →

How do I export Cypher Favorites recorded in the browser

Cypher Favorites are common Cypher statements which one can save to the left panel of the Neo4j browser. A Favorite is created by entering the Cypher at the top prompt and then clicking the Favorite icon to the right as… Read more →

How to resolve Python Bolt Driver when executed gives an error “(“Failed to establish connection to {!r}”.format(address))”

Take the example of Python with the latest Bolt driver 1.2. Here is the sample code from neo4j.v1 import GraphDatabase uri = “bolt://localhost:7687” driver = GraphDatabase.driver(uri, auth=(“neo4j”, “Password”)) and when run it gives the following error: Traceback (most recent call… Read more →

How to Configure Proxy in Neo4j Desktop

Organizations have proxy settings in order to access the internet or external websites. Neo4j Desktop has a way to setup proxy configuration so one can use their organization’s proxy settings. To setup Proxy in Neo4j Desktop: Click on the Settings… Read more →

Neo4j Desktop password change failure

This document provides info and resolution for the error message on a clean install of Desktop 1.0.2x, Neo4j DB version 3.3.x mentioning “Database failed to create: Error: Could not change password neo4j” Error: Error message on a clean install of… Read more →

Tuning Cypher queries by understanding cardinality

Cardinality issues are the most frequent culprit in slow or incorrect Cypher queries. Because of this, understanding cardinality, and using this understanding to manage cardinality issues, is a critical component in Cypher query tuning, and query correctness in general. A… Read more →

How do I determine the number of nodes and relationships to be effected by a detach delete

Prior to running a match …​. detach delete n; which will find said nodes and delete all relationships associated with said nodes as well as delete the nodes themselves one might want to run a query to determine how many… Read more →

Understanding Neo4j Query Plan Caching

This article is based on the behavior of Neo4j 2.3.2. Query plan caching is governed by three parameters, as defined in the conf/neo4j.properties file, which are detailed here. The three parameters which govern whether a Cypher statement is planned/replanned are:… Read more →

Running Docker as Non-Root User

When running Neo4j Docker, it will run as neo4j user inside the container. But to run docker as a different user one can specify the –user argument. Documentation has a section for running as non-root user: https://neo4j.com/docs/operations-manual/3.4/installation/docker/#docker-user but would like… Read more →

Updating a node but returning its state from before the update

Some use cases require updating node (or relationship) properties, but returning the node (or relationship) as it was prior to the update. You’ll need to get a ‘snapshot’ of the node before the update, and return that snapshot instead of… Read more →

How do I display all nodes with no defined labels

Although assigning a node one or more labels provides many benefits (i.e. performance gains from index usage, ability to group nodes into sets, etc), it is possible to create a node without any labels. The following Cypher can be used to… Read more →

Neo4j Streams – Kafka Integration – List of Must Gather for Troubleshooting

When troubleshooting issues on Neo4j Streams, use the below list of must gather information points to help investigating. Which Plugin/Module are you using? Neo4j Streams Source Neo4j Streams Sink Neo4j Streams Procedure Kafka Connect Sink. In case of using Sink,… Read more →

Neo4j current transaction commit process order

Transactions in Neo4j use a read-committed isolation level, which means they will see data as soon as it has been committed and will not see data in other transactions that have not yet been committed. This type of isolation is… Read more →

How to configure off-heap transaction state

This feature is experimental in 3.5, on by default in 4.0. Commencing with Neo4j 3.5, it is possible to store some of transactions’ data in off-heap memory. This can help to reduce GC pressure and/or prevent OOM crashes in a… Read more →

How do I view the column headers of a CSV file with LOAD CSV

If one has a CSV file with the following content id,name,dob,addr1,addr2,city,state,country 1,Joe Smith,04/23/1971,121 Main Street,San Mateo,CA,USA 2,Bill Williams,09/21/2008,43 Overlook St,San Mateo,CA, USA and one simply wants to run a LOAD CSV command to have the column headers returned, the following… Read more →

Getting “Permission Denied” errors after using neo4j-admin commands

If you have leveraged Debian or RPM Packages to install Neo4j on Linux (or used one of the Public Cloud Marketplace offerings), you need to be careful of file and folder permissions. The installs create a user: “neo4j” that owns… Read more →

Pass Temporal Objects as Parameters

With the support of datetime types in Neo4j, users might wonder how or if it works to transport those types along with other data types via the drivers. It is possible and supported to send temporal objects using one of… Read more →

Checkpointing and Log Pruning interactions

Overview Checkpointing is the process of flushing all pending page updates from the page cache to the store files. This is necessary for ensuring that the number of transactions that are in need of being replayed during recovery is kept… Read more →

Causal Cluster FAQ for heavy workloads

Lagging of follower instances and what causes it? The main reason for followers to fall behind is highly concurrent and continuous read/write workloads. This can cause the instances get overwhelmed which causes some extra latency in propagating the data to… Read more →

Cross Product Cypher queries will not perform well

Just like SQL, if you do not properly connect the parts of your query, it will result in a cross (cartesian) product, which is seldom what you want. Take the following example: MATCH (p:Person), (m:Movie) RETURN p, m; In Cypher,… Read more →