Commit graph

336 commits

Author SHA1 Message Date
e849da9402 graph: make quadstore init functions idempotent 2015-11-25 15:06:47 -05:00
Quentin Machu
a2622536e9 Fix SLOW DELETEs
subject, predicate, object and labels are not indexed, thus, using a where clause on these fields for the DELETE statement does a full-table scan. Using *_hash columns instead will use the indexes.
2015-11-18 18:42:20 -05:00
Quentin Machu
d874441431 Fix a deadlock behavior with DELETE transactions
It appears that preparing an INSERT statement on PostgreSQL actually makes it expecting to receive INSERTs and thus, it create some kind of locks for it. If instead, you only send him DELETE statements, it will indefinitely wait for an INSERT and will hung.
2015-11-17 20:32:21 -05:00
Quentin Machu
383cb339ac Ensure that quads in a transaction are applied in the desired order. 2015-11-17 12:10:59 -05:00
Quentin Machu
174a13cf23 Add a Size() estimator for PostgresSQL
Counting on PostgreSQL could be really slow because of its MVCC model. See https://wiki.postgresql.org/wiki/Count_estimate
2015-11-16 16:01:06 -05:00
277fc748e3 Combine AND(Fixed, SQL) into a single IN clause, reducing roundtrips. Add a test and benchmark. 2015-11-12 15:14:48 -05:00
831b14c23e graph/sql: Use an IN clause when optimizing a fixed iterator 2015-11-12 14:56:18 -05:00
3d286f5245 document path context, pipe it through Reversal() as well, and update the godoc 2015-10-28 23:12:37 -04:00
f74051a520 Rewrite Gremlin's buildIterator in terms of paths 2015-10-28 21:26:29 -04:00
97247ae40f add InPredicates/OutPredicates 2015-10-28 19:42:59 -04:00
b91b7ab824 bring the path test in line with the gremlin test, add Back() 2015-10-28 19:15:57 -04:00
bcbdb1f82a route context through graph.Path 2015-10-28 18:35:10 -04:00
Quentin Machu
3f5a4a7827 Fix NPE in SQL Quadstore
When `tx.Exec` fails and an error is returned, result is nil. Thus, `result.RowsAffected()` panics.

* Add a missing return statement in the error test.
* Add a second missing return statement just below to return the proper error message if we can't execute `RowsAffected` instead of saying that the triple doesn't exist.
2015-10-18 14:40:36 -04:00
Quentin Machu
91fc9ee3de Improve Transaction: deduplicate quads, allow adding/removing a quad in the same tx 2015-10-06 15:56:02 -04:00
Quentin Machu
45d96e14ec Improve Transaction: deduplicate quads, allow adding/removing a quad in the same tx 2015-10-06 15:21:33 -04:00
4ffda9ad3b Fix corners after dropping a couple merges 2015-10-05 17:45:42 -04:00
0c5f1bc364 Merge pull request #277 from barakmich/upgrade_db
Add migration tool and use protos in Bolt store
2015-10-05 17:22:05 -04:00
f7cdec8294 Merge pull request #289 from barakmich/psql
graph: Postgres backend
2015-10-05 17:20:55 -04:00
Tyler Gibbons
5c41e4fe5d Add periods throughout 2015-10-01 19:52:49 -07:00
Tyler Gibbons
893bd6ca00 Complete comment on line 60 2015-10-01 19:46:52 -07:00
Tyler Gibbons
4f69eb301c Fix copyright dates 2015-10-01 19:41:15 -07:00
Tyler Gibbons
0dd93f87a9 Fix mis-named packages, run tests 2015-10-01 19:14:17 -07:00
Tyler Gibbons
51f5a86232 Refactor for readability
Added more documentation, converted logical operations to (hopefully)
consistent 'route' metaphor, and moved all AND(iterator, iterator)
stanzas out into a single join() function that is more descriptive of
what's actually happening
2015-10-01 19:09:33 -07:00
42aa91b77f Merge pull request #296 from kortschak/bolt-panic
graph/bolt: don't panic on unitialised store
2015-09-18 05:34:59 -04:00
3e2b490063 Fixes memstore transaction semantics 2015-09-03 13:32:09 -04:00
fb7e200551 Respect IgnoreMissing, which SQL does silently. Fixes barakmich/psql #10 2015-09-02 16:26:18 -04:00
fc6f7b3ea7 Merge pull request #9 from Quentin-M/psql-fail-fast-open
Make the SQL connection fail-fast
2015-08-26 16:19:35 -04:00
Quentin Machu
13b11e46a4 Make the SQL connection fail-fast 2015-08-26 02:10:27 -04:00
Quentin Machu
7ddeb101ca Fix NPEs in SQL Next and Contains 2015-08-26 01:19:28 -04:00
kortschak
88262ac344 graph/bolt: don't panic on unitialised store
Fixes #295.
2015-08-17 09:46:18 +09:30
ebaf8b2a98 Can't use distinct, fix double-hashing bug
remove distinctness, make printing the SQL query part of describe

clean up quadstore a bit, add noSizes as an external option
2015-08-12 16:03:25 -04:00
fab8cd64b3 Option to remove size calls
Fix permutations of optimization intersections

Return empty string as per bolt

fix case sensitivity and memstore panic
2015-08-12 16:03:25 -04:00
aedd0401e2 Fix up hash interface and speed up save queries 10x
Fix all optimizer
2015-08-12 16:03:25 -04:00
ab3f59d21f Add hash-based indexes 2015-08-12 16:03:25 -04:00
c98318aa97 Fix tests and update Godep 2015-08-12 16:03:25 -04:00
8830760df2 Split intersection and node iteration into two logical SQL iterators 2015-08-12 16:03:25 -04:00
3e02bb2b71 refactor to SQL builder iterators and standard iterator wrapper 2015-08-12 16:03:25 -04:00
b754810c6e Remove old iterator code, leaving a simple all-iterator for the sql backend 2015-08-12 16:03:25 -04:00
425292811b First reasonably fast integration test 2015-08-12 16:03:25 -04:00
13d4d8b7b4 revert to non-subquery mode 2015-08-12 16:03:25 -04:00
7153a766c1 Add new builder iterators, v2
Subcommits:

link iterator next/contains

implement sql_node_iterator next/buildsql

fix optimizers
2015-08-12 16:03:25 -04:00
621acae945 Optimize by collapsing trees into single SQL queries 2015-08-12 16:03:25 -04:00
185e236f15 attempt to build more interesting SQL queries
Subcommits:

fix old iterator, and flesh out new builder iterator

fix contains for builder iterator

Working replacement iterator
2015-08-12 16:03:25 -04:00
da391c3db7 optional index strategies 2015-08-12 16:03:25 -04:00
3f391a782c first working-ish Postgres backend
Subcommits:

implement iterator and remove ResultTree

add Err() to sql

remove redundant and less helpful indices, change fillfactor, and use COPY FROM
2015-08-12 16:03:25 -04:00
ac1fa668e7 Add check for multiple all iterators
Update test to reflect that the two Alls will be collapsed,
also fix the test of tag optimization to use fixed iterators.
2015-08-12 15:26:19 -04:00
13640290ce Merge pull request #262 from neonstalwart/string-comparison-iterator
add string comparison to value comparison iterator
2015-07-31 17:12:38 -04:00
Igor Mihalik
a8c885a5e8 Fixed multiplier for position of "label" in case of "po" key entry
in "po", the ordering is {"predicate","object","subject","label"} thus the offset of label is 3*hashSize+2
2015-07-28 14:09:23 +02:00
Michael Schurter
db8353a7f1 Missed a test usage of old go-uuid import 2015-06-29 10:08:37 -07:00
Michael Schurter
dfb9939d86 Use new import path for go-uuid 2015-06-26 14:05:10 -07:00