PHOENIX-6385 : For non-small Scan, not to use Scan#setSmall for HBase 2.x versions (#1167)

Signed-off-by: Anoop Sam John <anoopsamjohn@apache.org>
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
index e20d006..45a4ddc 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
@@ -180,12 +180,19 @@
             newScan.setFamilyMap(clonedMap);
             // Carry over the reversed attribute
             newScan.setReversed(scan.isReversed());
-            newScan.setSmall(scan.isSmall());
+            if (scan.isSmall()) {
+                // HBASE-25644 : Only if Scan#setSmall(boolean) is called with
+                // true, readType should be set PREAD. For non-small scan,
+                // setting setSmall(false) is redundant and degrades perf
+                // without HBASE-25644 fix.
+                newScan.setSmall(true);
+            }
             return newScan;
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
     }
+
     /**
      * Intersects the scan start/stop row with the startKey and stopKey
      * @param scan