Skip to content

Add foreign keys to PostgreSQL schema #110

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

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

petere
Copy link
Contributor

@petere petere commented Apr 14, 2020

I'm wondering why the schema for PostgreSQL doesn't have foreign keys defined. I didn't find anything in the benchmark spec about whether or not they should exist. It seems a "proper" database schema should have them, and they make understanding some parts of the schema easier.

Clearly this would affect performance of the update queries, so we probably can't just add them, hence in a separate file. Perhaps this is something the next version of the benchmark can address?

@szarnyasg szarnyasg changed the base branch from master to dev April 14, 2020 12:04
@szarnyasg szarnyasg changed the base branch from dev to master April 14, 2020 12:04
@szarnyasg
Copy link
Member

@petere it's a good question why FKs weren't implemented so far. The people who have created the Postges have moved on from this collaboration so it'd be difficult to ask them. Probably there's no need, adding FKs is clearly an improvement.

I'm cc-ing @jmarton in case he has any comments.

@szarnyasg
Copy link
Member

szarnyasg commented Apr 14, 2020

Had a discussion with @jmarton on Slack regarding this PR & concluded to merge. Thanks!

@szarnyasg szarnyasg merged commit 6a3cd67 into ldbc:master Apr 14, 2020
@petere
Copy link
Contributor Author

petere commented Apr 16, 2020

Looks like this was disabled. Did anything not work? I did test the update queries in the "interactive" set, and they passed.

@szarnyasg
Copy link
Member

@petere They failed the CI test. It's probably something about the tests - I'm looking into it now.

Tests run: 36, Failures: 0, Errors: 14, Skipped: 0, Time elapsed: 71.584 sec <<< FAILURE!
testUpdateQuery2(postgresql.PostgresInteractiveTest)  Time elapsed: 10.047 sec  <<< ERROR!
com.ldbc.driver.DbException: org.postgresql.util.PSQLException: ERROR: insert or update on table "likes" violates foreign key constraint "likes_l_personid_fkey"
  Detail: Key (l_personid)=(1021) is not present in table "person".
	at com.ldbc.impls.workloads.ldbc.snb.postgres.operationhandlers.PostgresUpdateOperationHandler.executeOperation(PostgresUpdateOperationHandler.java:25)
	at com.ldbc.impls.workloads.ldbc.snb.postgres.operationhandlers.PostgresUpdateOperationHandler.executeOperation(PostgresUpdateOperationHandler.java:13)
	at com.ldbc.impls.workloads.ldbc.snb.SnbTest.runOperation(SnbTest.java:44)
	at com.ldbc.impls.workloads.ldbc.snb.SnbTest.run(SnbTest.java:50)
	at com.ldbc.impls.workloads.ldbc.snb.interactive.InteractiveTest.testUpdateQuery2(InteractiveTest.java:178)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

@petere petere deleted the postgres-foreign-keys branch April 14, 2023 13:08
chinyajie pushed a commit to QY-Graph/ldbc_snb_interactive_v1_impls that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants