diff --git a/worker/trigram.go b/worker/trigram.go
index 2feb2f5b6fae2adec61bc5b755ff9649550cbfb5..113d4b042057a4c30da80fac867efd020d9b9b41 100644
--- a/worker/trigram.go
+++ b/worker/trigram.go
@@ -19,8 +19,6 @@ import (
 	"github.com/dgraph-io/dgraph/x"
 )
 
-const maxUidsForTrigram = 1000000
-
 var regexTooWideErr = errors.New("Regular expression is too wide-ranging and can't be executed efficiently.")
 
 func uidsForRegex(attr string, arg funcArgs,
@@ -58,8 +56,6 @@ func uidsForRegex(attr string, arg funcArgs,
 
 			if results.Size() == 0 {
 				return results, nil
-			} else if results.Size() > maxUidsForTrigram {
-				return nil, regexTooWideErr
 			}
 		}
 		for _, sub := range query.Sub {
@@ -74,8 +70,6 @@ func uidsForRegex(attr string, arg funcArgs,
 			}
 			if results.Size() == 0 {
 				return results, nil
-			} else if results.Size() > maxUidsForTrigram {
-				return nil, regexTooWideErr
 			}
 		}
 	case cindex.QOr:
@@ -98,9 +92,6 @@ func uidsForRegex(attr string, arg funcArgs,
 				return nil, err
 			}
 			results = algo.MergeSorted([]*intern.List{results, subUids})
-			if results.Size() > maxUidsForTrigram {
-				return nil, regexTooWideErr
-			}
 		}
 	default:
 		return nil, regexTooWideErr