Skip to content

Commit

Permalink
Since the two branches of the UNION produce disjoint sets, do a UNION…
Browse files Browse the repository at this point in the history
… ALL

 so as to eliminate the need for a sort/eliminate duplicates step.
  • Loading branch information
ncabatoff committed Apr 8, 2019
1 parent 0405186 commit d1e5ee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion physical/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewPostgreSQLBackend(conf map[string]string, logger log.Logger) (physical.B
get_query: "SELECT value FROM " + quoted_table + " WHERE path = $1 AND key = $2",
delete_query: "DELETE FROM " + quoted_table + " WHERE path = $1 AND key = $2",
list_query: "SELECT key FROM " + quoted_table + " WHERE path = $1" +
"UNION SELECT DISTINCT substring(substr(path, length($1)+1) from '^.*?/') FROM " +
"UNION ALL SELECT DISTINCT substring(substr(path, length($1)+1) from '^.*?/') FROM " +
quoted_table + " WHERE parent_path LIKE $1 || '%'",
logger: logger,
permitPool: physical.NewPermitPool(maxParInt),
Expand Down

0 comments on commit d1e5ee6

Please sign in to comment.