Andey Bille & Vlada Pogozhelskaya
Index Cond: (i = 0)
(2 rows)
Index Cond: (i = 0)
(2 rows)
+SELECT 1 AS one;
+ one
+-----
+ 1
+(1 row)
+
+RESET ALL;
RelOptInfo *rel)
{
#endif
RelOptInfo *rel)
{
#endif
- Relation relation;
-
- relation = heap_open(relationObjectId, NoLock);
- if (relation->rd_rel->relkind == RELKIND_RELATION)
+#if PG_VERSION_NUM >= 190000
+ if (rte->rtekind == RTE_RELATION &&
+ rte->relkind == RELKIND_RELATION)
+#endif
- if (fix_empty_table && RelationGetNumberOfBlocks(relation) == 0)
+ Relation relation;
+
+#if PG_VERSION_NUM >= 190000
+ Assert(OidIsValid(relationObjectId));
+#endif
+ relation = heap_open(relationObjectId, NoLock);
+ if (relation->rd_rel->relkind == RELKIND_RELATION)
- /*
- * estimate_rel_size() could be too pessimistic for particular
- * workload
- */
- rel->pages = 1.0;
- rel->tuples = 0.0;
- }
+ if (fix_empty_table && RelationGetNumberOfBlocks(relation) == 0)
+ {
+ /*
+ * estimate_rel_size() could be too pessimistic for particular
+ * workload
+ */
+ rel->pages = 1.0;
+ rel->tuples = 0.0;
+ }
- indexFilter(root, relationObjectId, inhparent, rel);
+ indexFilter(root, relationObjectId, inhparent, rel);
+ }
+ heap_close(relation, NoLock);
- heap_close(relation, NoLock);
/*
* Call next hook if it exists
/*
* Call next hook if it exists
RESET plantuner.only_index;
EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
RESET plantuner.only_index;
EXPLAIN (COSTS OFF) SELECT * FROM wow WHERE i = 0;
+
+SELECT 1 AS one;
+RESET ALL;