Re: syslog output from explain looks weird...

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: PostgreSQL Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: syslog output from explain looks weird...
Date: 2000-11-22 22:54:21
Message-ID: 20001122165421.A12825@lerami.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Larry Rosenman <ler(at)lerctr(dot)org> [001122 15:25]:
> * Larry Rosenman <ler(at)lerctr(dot)org> [001122 15:03]:
> > Just playing with the syslog functionality on 7.1devel, and the
> > explain output looks weird to me:
> >
> > Nov 22 14:58:44 lerami pg-test[4005]: [2] DEBUG: MoveOfflineLogs:
> > skip 0000000000000006
> > Nov 22 14:58:44 lerami pg-test[4005]: [3] DEBUG: MoveOfflineLogs:
> > skip 0000000000000005
> > Nov 22 14:59:09 lerami pg-test[4005]: [4] NOTICE: QUERY PLAN:
> > Nov 22 14:59:0 lerami Nov 22 14:59:09Index Scan using upslog_index on
> > upslog (cost=0.00..88.65 rows=165 width=28)
> >
> > seems like it should be better.
> >
> > The output at the client looks fine:
> > ler=# explain select * from upslog where upslogdate >='2000-11-01';
> > NOTICE: QUERY PLAN:
> >
> > Index Scan using upslog_index on upslog (cost=0.00..88.65 rows=165
> > width=28)
> >
> > EXPLAIN
> > ler=#
> And here is a fix. What appears to piss off my syslogd is the no
> character lines. So, I added spaces to the output. The new client
> output looks like:
> ler=# explain select * from upslog where upslogdate>='2000-11-01';
> NOTICE: QUERY PLAN:
>
> Index Scan using upslog_index on upslog (cost=0.00..88.65 rows=165
> width=28)
>
> EXPLAIN
> ler=# \q
> $
>
> and the syslog looks like:
> Nov 22 15:22:56 lerami pg-test[8299]: [2] NOTICE: QUERY PLAN:
> Nov 22 15:22:56 lerami
> Nov 22 15:22:56 lerami Index Scan using upslog_index on upslog
> (cost=0.00..88.65 rows=165 width=28)
>
Looking some more, I found some other places that need a space (I
suspect...), so here is an updated patch.

Index: src/backend/commands/explain.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/explain.c,v
retrieving revision 1.62
diff -c -r1.62 explain.c
*** src/backend/commands/explain.c 2000/11/12 00:36:56 1.62
--- src/backend/commands/explain.c 2000/11/22 22:52:39
***************
*** 110,116 ****
s = nodeToString(plan);
if (s)
{
! elog(NOTICE, "QUERY DUMP:\n\n%s", s);
pfree(s);
}
}
--- 110,116 ----
s = nodeToString(plan);
if (s)
{
! elog(NOTICE, "QUERY DUMP:\n \n %s", s);
pfree(s);
}
}
***************
*** 120,126 ****
s = Explain_PlanToString(plan, es);
if (s)
{
! elog(NOTICE, "QUERY PLAN:\n\n%s", s);
pfree(s);
}
}
--- 120,126 ----
s = Explain_PlanToString(plan, es);
if (s)
{
! elog(NOTICE, "QUERY PLAN:\n \n %s", s);
pfree(s);
}
}
***************
*** 149,155 ****

if (plan == NULL)
{
! appendStringInfo(str, "\n");
return;
}

--- 149,155 ----

if (plan == NULL)
{
! appendStringInfo(str, "\n ");
return;
}

***************
*** 283,289 ****
plan->startup_cost, plan->total_cost,
plan->plan_rows, plan->plan_width);
}
! appendStringInfo(str, "\n");

/* initPlan-s */
if (plan->initPlan)
--- 283,289 ----
plan->startup_cost, plan->total_cost,
plan->plan_rows, plan->plan_width);
}
! appendStringInfo(str, "\n ");

/* initPlan-s */
if (plan->initPlan)
***************
*** 293,299 ****

for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
! appendStringInfo(str, " InitPlan\n");
foreach(lst, plan->initPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
--- 293,299 ----

for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
! appendStringInfo(str, " InitPlan\n ");
foreach(lst, plan->initPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
***************
*** 369,375 ****

for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
! appendStringInfo(str, " SubPlan\n");
foreach(lst, plan->subPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
--- 369,375 ----

for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
! appendStringInfo(str, " SubPlan\n ");
foreach(lst, plan->subPlan)
{
es->rtable = ((SubPlan *) lfirst(lst))->rtable;
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 (voice) Internet: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jmscott 2000-11-22 23:59:08 Re: Table/Column Constraints
Previous Message Mikheev, Vadim 2000-11-22 22:06:31 RE: Talkative initdb, elog message levels