Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema: fails to load certain structs with depth=0 #764

Closed
tucnak opened this issue Feb 12, 2019 · 2 comments
Closed

schema: fails to load certain structs with depth=0 #764

tucnak opened this issue Feb 12, 2019 · 2 comments
Assignees
Milestone

Comments

@tucnak
Copy link

tucnak commented Feb 12, 2019

Schema package fails to load certain structs and has overall bad performance on certain structs.
I've made a toy knowledge graph proof of concept implementation (Gist code) illustrating this bug and timed its performance.

Dataset (n-quads, 2mb compressed) used: knols.nq.zip

Structs are in tact with the dataset and are valid AFAIK.

Received results:

I'm timing four actions:

(a) get ids for 10 critique nodes
(b) load 10 actor nodes with depth=0
(c) load 10 knol nodes with depth=0
(d) load 10 critique nodes with depth=0

First, (a) performs in 11ms, which is great, but then (b) it takes over 102ms to load, and Actor is a rather small struct. (c) it's just the same, but now I'm fetching knols nodes instead. Ids are successfully retrieved, but then it fails to load and returns "not found" error. For (d) behaviour is the same as in (c) but it fails silently.

2019/02/12 05:04:03 n = 10
2019/02/12 05:04:03
2019/02/12 05:04:03 [find n critiques] started
2019/02/12 05:04:04 found 10 crits
2019/02/12 05:04:04 elapsed: 11.835827ms
2019/02/12 05:04:04
2019/02/12 05:04:04 [get n actors + depth=0] started
2019/02/12 05:04:04 found 10 actors
listening...
- 1 2019-02-09 18:27:29.214357 +0200 EET
- 2 2019-02-09 18:27:29.214357 +0200 EET
- 3 2019-02-09 18:27:29.214357 +0200 EET
- 4 2019-02-09 18:27:29.214357 +0200 EET
- 5 2019-02-09 18:27:29.214357 +0200 EET
- 6 2019-02-09 18:27:29.214357 +0200 EET
- 7 2019-02-09 18:27:29.214357 +0200 EET
- 8 2019-02-09 18:27:29.214357 +0200 EET
- 9 2019-02-09 18:27:29.214357 +0200 EET
- 10 2019-02-09 18:27:29.214357 +0200 EET
no more
2019/02/12 05:04:04 elapsed: 102.027236ms
2019/02/12 05:04:04
2019/02/12 05:04:04 [get n knols + depth=0] started
2019/02/12 05:04:04 found 8 knols
listening...
2019/02/12 05:04:04 not found
no more
2019/02/12 05:04:04 elapsed: 55.915941ms
2019/02/12 05:04:04
2019/02/12 05:04:04 [get n crits + depth=0] started
2019/02/12 05:04:04 found 10 critiques
listening...
no more
2019/02/12 05:04:04 elapsed: 66.925599ms
2019/02/12 05:04:04

Output of cayley version or commit hash: acf0ab2

Cayley version: 0.7.5

Environment details:

Backend database: postgres 10.5

@dennwc

@tucnak tucnak changed the title schema: fails to load certain struct types with depth=0 schema: fails to load certain structs with depth=0 Feb 12, 2019
@tucnak
Copy link
Author

tucnak commented Feb 12, 2019

Poor performance in this case is apparently influenced to a great extent by #765.

@dennwc dennwc added this to the v0.7.6 milestone Feb 12, 2019
@dennwc dennwc self-assigned this Feb 12, 2019
@dennwc dennwc added the bug label Feb 12, 2019
@dennwc dennwc added the schema label Jun 28, 2019
@dennwc dennwc added invalid and removed bug labels Oct 14, 2019
@dennwc
Copy link
Member

dennwc commented Oct 14, 2019

This issue is invalid: the dataset contains no Remark nodes, but tas:remarks constraint is set to req (required). So you should either remove req or add relevant data.

Closing this one, the performance issues will be tracked by #765.

@dennwc dennwc closed this as completed Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants