10000 we can handle select * with selection condition · mpws2013n1/postgres@5973072 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5973072

Browse files
committed
we can handle select * with selection condition
1 parent 3299298 commit 5973072

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/executor/execProcnode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ LookForFilterWithEquality(PlanState* result, Oid tableOid, List* qual)
566566
break;
567567
}
568568

569+
// invalid all columns of this table, because there is a selection
570+
InvalidateStatisticsForTable(tableOid);
571+
569572
// the magic numbers are operator identifiers from posgres/src/include/catalog/pg_operator.h
570573
// equals
571574
if(opno == 94 || opno == 96 || opno == 410 || opno == 416 || opno == 1862 || opno == 1868 || opno == 15 || opno == 532 || opno == 533) { // it is a equality like number_of_tracks = 3
@@ -626,7 +629,7 @@ LookForFilterWithEquality(PlanState* result, Oid tableOid, List* qual)
626629
else {
627630
printf("this opno is no =, <, >, <= or >=: %d (for column id %d)\n", opno, columnId);
628631
// found a selection, therefore we cannot use old statistics
629-
InvalidateStatisticsForTable(tableOid);
632+
// InvalidateStatisticsForTable(tableOid); (this has to be always, because there could be more than one column of this table in the result
630633
}
631634
}
632635
}

0 commit comments

Comments
 (0)
0