Re: Cost and execution plan

2019-06-26 Thread Tom Lane
AminPG Jaffer  writes:
> We are facing an issue where the cost shows up "cost=100.00" so
> trying to find where that is set.

That means you've turned off enable_seqscan (or one of its siblings)
but the planner is choosing a seqscan plan (or other plan type you
tried to disable) anyway because it has no other alternative.

> Could anyone point me to the code where the cost "cost=100.00" is
> set?

Look for disable_cost.

regards, tom lane




Cost and execution plan

2019-06-26 Thread AminPG Jaffer
Hi

We are facing an issue where the cost shows up "cost=100.00" so
trying to find where that is set.

Could anyone point me to the code where the cost "cost=100.00" is
set?

It doesn't show up when searching through find.

find . -type f -print | xargs grep 100 | grep -v "/test/" | grep -v
"/btree_gist/"
./postgresql-9.6.12/contrib/pgcrypto/sql/blowfish.sql:decode('1001',
'hex'),
./postgresql-9.6.12/contrib/pgcrypto/expected/blowfish.out:decode('1001',
'hex'),
./postgresql-9.6.12/doc/src/sgml/html/functions-admin.html:
0001000D | 4039624
./postgresql-9.6.12/doc/src/sgml/html/wal-internals.html:>00010001.  The numbers do not wrap,
./postgresql-9.6.12/src/bin/pg_archivecleanup/pg_archivecleanup.c:   *
00010010.partial and
./postgresql-9.6.12/src/bin/pg_archivecleanup/pg_archivecleanup.c:   *
00010010.0020.backup are after
./postgresql-9.6.12/src/bin/pg_archivecleanup/pg_archivecleanup.c:   *
00010010.
./postgresql-9.6.12/src/bin/pg_archivecleanup/pg_archivecleanup.c:
"  pg_archivecleanup /mnt/server/archiverdir
00010010.0020.backup\n");
./postgresql-9.6.12/src/backend/utils/adt/numeric.c: * For input like
100, we must treat stripped digits as real. So
./postgresql-9.6.12/src/backend/utils/adt/numeric.c: * For input like
100, we must treat stripped digits as real. So
./postgresql-9.6.12/src/backend/utils/adt/cash.c:   m4 = (val /
INT64CONST(1000)) % 1000;   /* billions */
./postgresql-9.6.12/src/backend/utils/adt/cash.c:   m5 = (val /
INT64CONST(100)) % 1000;/* trillions */
./postgresql-9.6.12/src/backend/utils/adt/cash.c:   m6 = (val /
INT64CONST(10)) % 1000; /* quadrillions */
./postgresql-9.6.12/src/backend/utils/adt/date.c:
100.0
./postgresql-9.6.12/src/include/utils/date.h:#define TIME_PREC_INV
100.0


Thanks