Fix up hash interface and speed up save queries 10x

Fix all optimizer
This commit is contained in:
Barak Michener 2015-08-10 15:41:22 -04:00
parent ab3f59d21f
commit aedd0401e2
5 changed files with 26 additions and 12 deletions

View file

@ -160,11 +160,14 @@ func (n *SQLNodeIterator) buildWhere() (string, []string) {
return query, vals
}
func (n *SQLNodeIterator) buildSQL(next bool, val graph.Value, _ bool) (string, []string) {
func (n *SQLNodeIterator) buildSQL(next bool, val graph.Value, topLevel bool) (string, []string) {
topData := n.tableID()
tags := []tagDir{topData}
tags = append(tags, n.getTags()...)
query := "SELECT DISTINCT "
query := "SELECT "
if topLevel {
query += "DISTINCT "
}
var t []string
for _, v := range tags {
t = append(t, v.String())