Skip to content

Bug: Poor Postgres Performance #1969

@spyr0-sec

Description

@spyr0-sec

Description:

As discussed in the Slack thread, we are experiencing degraded performance when using the postgres database driver. The most noticeable issue is around multi-hop queries.

The example used in the thread was this but any strongly typed multi hop query seems to either hang or take a very long time.

MATCH p = (n:Base)-[:HAS_ACCESS_TO]->(:Safe)-[:Contains]->(:Secret)-[:CredentialOf]->(:Computer)

As this is using a mixture of AD and OpenGraph nodes, during debugging I was initially using the "Contains" edge which is already in-built, changing this to something custom did at the time seem to provide a bit of a performance boost but I think it may have been placebo.

Are you intending to fix this bug?

Happy to assist with any debugging / testing Postgres tuning

Component(s) Affected:

  • UI
  • API
  • PostgreSQL

Steps to Reproduce:

  1. Ingest AD and OpenGraph Data
  2. Execute a multi-hop query such as the one above

Expected Behavior:

Graph data is returned in a reasonable amount of time.

Actual Behavior:

Data either does not return or takes a considerable amount of time.

Screenshots/Code Snippets/Sample Files:

N/A

Environment Information:

BloodHound: v8.2.0

Database: postgres:16

Additional Information:

https://bloodhoundhq.slack.com/archives/C20NG2L87/p1759060061111959?thread_ts=1759060061.111959&cid=C20NG2L87

Potential Solution (optional):

PostgreSQL tuning

Related Issues:

N/A

Contributor Checklist:

  • I have searched the issue tracker to ensure this bug hasn't been reported before or is not already being addressed.
  • I have provided clear steps to reproduce the issue.
  • I have included relevant environment information details.
  • I have attached necessary supporting documents.
  • I have checked that any JSON files I am attempting to upload to BloodHound are valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThis issue requires triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions