patch for explain.c that shows index (il secondo)

Started by Zeugswetter Andreas SARZover 27 years ago2 messages
#1Zeugswetter Andreas SARZ
Andreas.Zeugswetter@telecom.at
1 attachment(s)

<<show_index.patch>>

Scrappy, can you apply it to current CVS please

Andreas

Attachments:

show_index.patchapplication/octet-stream; name=show_index.patchDownload
--- src/backend/commands/explain.c	Tue Mar  3 21:10:34 1998
+++ src/backend/commands/explain.c.orig	Thu Feb 26 05:30:58 1998
@@ -23,6 +23,7 @@
 #include <parser/parse_node.h>
 #include <optimizer/planner.h>
 #include <access/xact.h>
+#include <utils/relcache.h>
 
 typedef struct ExplainState
 {
@@ -117,6 +118,8 @@
 static void
 explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
 {
+	List		*l;
+	Relation	relation;
 	char	   *pname;
 	char		buf[1000];
 	int			i;
@@ -184,8 +187,12 @@
 	appendStringInfo(str, pname);
 	switch (nodeTag(plan))
 	{
-		case T_SeqScan:
 		case T_IndexScan:
+			appendStringInfo(str, " using ");
+			l = ((IndexScan *) plan)->indxid;
+			relation = RelationIdCacheGetRelation((int) lfirst(l));
+			appendStringInfo(str, (RelationGetRelationName(relation))->data);
+		case T_SeqScan:
 			if (((Scan *) plan)->scanrelid > 0)
 			{
 				RangeTblEntry *rte = nth(((Scan *) plan)->scanrelid - 1, es->rtable);
#2The Hermit Hacker
scrappy@hub.org
In reply to: Zeugswetter Andreas SARZ (#1)
Re: [HACKERS] patch for explain.c that shows index (il secondo)

Applied...

On Wed, 22 Apr 1998, Zeugswetter Andreas SARZ wrote:

Show quoted text

<<show_index.patch>>

Scrappy, can you apply it to current CVS please

Andreas