agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
A minor bug in doc. Hovering over heading shows # besides it.
36+ messages / 10 participants
[nested] [flat]

* A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 04:55  Muhammad Ikram <mmikram@gmail.com>
  0 siblings, 3 replies; 36+ messages in thread

From: Muhammad Ikram @ 2024-07-18 04:55 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

Hi,

On page

https://www.postgresql.org/docs/devel/ddl-basics.html

5.1. Table Basics #
<https://www.postgresql.org/docs/devel/ddl-basics.html#DDL-BASICS;

when we hover over Table Basics, it shows # sign postfixed. I think it
needs to be removed

--
Regards,
Muhammad Ikram
Bitnine Global

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:02  Kashif Zeeshan <kashi.zeeshan@gmail.com>
  parent: Muhammad Ikram <mmikram@gmail.com>
  2 siblings, 1 reply; 36+ messages in thread

From: Kashif Zeeshan @ 2024-07-18 05:02 UTC (permalink / raw)
  To: Muhammad Ikram <mmikram@gmail.com>; +Cc: pgsql-docs@lists.postgresql.org

Hi

I have checked other pages too and the issue is only with this page.

Regards
Kashif Zeeshan

On Thu, Jul 18, 2024 at 9:55 AM Muhammad Ikram <mmikram@gmail.com> wrote:

>
> Hi,
>
> On page
>
> https://www.postgresql.org/docs/devel/ddl-basics.html
>
> 5.1. Table Basics # <https://www.postgresql.org/docs/devel/ddl-basics.html#DDL-BASICS;
>
> when we hover over Table Basics, it shows # sign postfixed. I think it needs to be removed
>
> --
> Regards,
> Muhammad Ikram
> Bitnine Global
>

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:06  David G. Johnston <david.g.johnston@gmail.com>
  parent: Muhammad Ikram <mmikram@gmail.com>
  2 siblings, 0 replies; 36+ messages in thread

From: David G. Johnston @ 2024-07-18 05:06 UTC (permalink / raw)
  To: Muhammad Ikram <mmikram@gmail.com>; +Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Wednesday, July 17, 2024, Muhammad Ikram <mmikram@gmail.com> wrote:

>
> Hi,
>
> On page
>
> https://www.postgresql.org/docs/devel/ddl-basics.html
>
> 5.1. Table Basics # <https://www.postgresql.org/docs/devel/ddl-basics.html#DDL-BASICS;
>
> when we hover over Table Basics, it shows # sign postfixed. I think it needs to be removed
>
>
>
That is telling you that this location on the page contains an anchor.  If
you click it your URL changes to include an anchor reference taking you
directly to that spot.

https://www.postgresql.org/docs/current/ddl-basics.html#DDL-BASICS

David J.

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:07  David G. Johnston <david.g.johnston@gmail.com>
  parent: Kashif Zeeshan <kashi.zeeshan@gmail.com>
  0 siblings, 0 replies; 36+ messages in thread

From: David G. Johnston @ 2024-07-18 05:07 UTC (permalink / raw)
  To: Kashif Zeeshan <kashi.zeeshan@gmail.com>; +Cc: Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Wednesday, July 17, 2024, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:
>
>
> I have checked other pages too and the issue is only with this page.
>

 There are like thousands of them…

https://www.postgresql.org/docs/current/ddl-generated-columns.html#DDL-GENERATED-COLUMNS

David J.

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:07  David Rowley <dgrowleyml@gmail.com>
  parent: Muhammad Ikram <mmikram@gmail.com>
  2 siblings, 2 replies; 36+ messages in thread

From: David Rowley @ 2024-07-18 05:07 UTC (permalink / raw)
  To: Muhammad Ikram <mmikram@gmail.com>; +Cc: pgsql-docs@lists.postgresql.org

On Thu, 18 Jul 2024 at 16:55, Muhammad Ikram <mmikram@gmail.com> wrote:
> 5.1. Table Basics #
>
> when we hover over Table Basics, it shows # sign postfixed. I think it needs to be removed

Those are meant to be there. They allow you to copy a URL directly to
that doc section.

In [1], there was some talk about using another more suitable
character. If the purpose of the '#' isn't obvious, then maybe we
should use something else.

David

https://www.postgresql.org/message-id/CAAKRu_Z1Xsjmv3b-JaGg2e1JLE2GCZe3+zX7C7WGbraJBfvvzg@mail.gmail...





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:17  Kashif Zeeshan <kashi.zeeshan@gmail.com>
  parent: David Rowley <dgrowleyml@gmail.com>
  1 sibling, 0 replies; 36+ messages in thread

From: Kashif Zeeshan @ 2024-07-18 05:17 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

Hi David

Thanks for the clarification.

Regards
Kashif Zeeshan

On Thu, Jul 18, 2024 at 10:07 AM David Rowley <dgrowleyml@gmail.com> wrote:

> On Thu, 18 Jul 2024 at 16:55, Muhammad Ikram <mmikram@gmail.com> wrote:
> > 5.1. Table Basics #
> >
> > when we hover over Table Basics, it shows # sign postfixed. I think it
> needs to be removed
>
> Those are meant to be there. They allow you to copy a URL directly to
> that doc section.
>
> In [1], there was some talk about using another more suitable
> character. If the purpose of the '#' isn't obvious, then maybe we
> should use something else.
>
> David
>
>
> https://www.postgresql.org/message-id/CAAKRu_Z1Xsjmv3b-JaGg2e1JLE2GCZe3+zX7C7WGbraJBfvvzg@mail.gmail...
>
>
>

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:18  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David Rowley <dgrowleyml@gmail.com>
  1 sibling, 3 replies; 36+ messages in thread

From: Tom Lane @ 2024-07-18 05:18 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

David Rowley <dgrowleyml@gmail.com> writes:
> On Thu, 18 Jul 2024 at 16:55, Muhammad Ikram <mmikram@gmail.com> wrote:
>> when we hover over Table Basics, it shows # sign postfixed. I think it needs to be removed

> In [1], there was some talk about using another more suitable
> character. If the purpose of the '#' isn't obvious, then maybe we
> should use something else.

Yeah.  I've found this new feature useful multiple times already,
but the '#' icon is as non-mnemonic and unobvious as could possibly
be.  OTOH, I don't know of a standard icon for this feature.

I wonder if we could make a tooltip worded like "link to this header"
pop up when you hover over the '#'?  That'd improve things a lot
even if we had a better icon.

A different idea is to dispense with the icon and make the section
title itself be a link to itself.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 05:45  David G. Johnston <david.g.johnston@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 36+ messages in thread

From: David G. Johnston @ 2024-07-18 05:45 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Wednesday, July 17, 2024, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> David Rowley <dgrowleyml@gmail.com> writes:
> > On Thu, 18 Jul 2024 at 16:55, Muhammad Ikram <mmikram@gmail.com> wrote:
> >> when we hover over Table Basics, it shows # sign postfixed. I think it
> needs to be removed
>
> > In [1], there was some talk about using another more suitable
> > character. If the purpose of the '#' isn't obvious, then maybe we
> > should use something else.
>
> Yeah.  I've found this new feature useful multiple times already,
> but the '#' icon is as non-mnemonic and unobvious as could possibly
> be.  OTOH, I don't know of a standard icon for this feature.


The fact that clicking this gave me a link with “#ANCHOR” appended to it
made the use of # make perfect sense, at least in hindsight.

Can we use a boat anchor symbol?

I get that my ideas do have the problem that I’m familiar with web
nomenclature and details at a lower level than most of the readers we are
trying to help with this change…

I feel the bug here, though possibly rarely to be read, is to note this
behavior on the “Conventions” page.


> A different idea is to dispense with the icon and make the section
> title itself be a link to itself.
>

If that includes styling it would solve what I’d say is the bigger issue
that where these anchors exist is not always visible.  I suppose
understanding all major headings should have links makes sense, but we’ve
probably got 30% (w.a.g.) of our tables with them as well.  It also would
have helped here possibly by not looking like a random buggy thing on
mouse-over but instead quite evidently part of our navigation.

David J.

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 06:40  David Rowley <dgrowleyml@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-07-18 06:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 18 Jul 2024 at 17:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Yeah.  I've found this new feature useful multiple times already,
> but the '#' icon is as non-mnemonic and unobvious as could possibly
> be.  OTOH, I don't know of a standard icon for this feature.

I also find it useful and certainly don't want it to disappear.

There's a unicode character for it.
https://www.unicodepedia.com/unicode/miscellaneous-symbols-and-pictographs/1f517/link-symbol/

David





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 07:19  Dean Rasheed <dean.a.rasheed@gmail.com>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 0 replies; 36+ messages in thread

From: Dean Rasheed @ 2024-07-18 07:19 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 18 Jul 2024 at 07:40, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Thu, 18 Jul 2024 at 17:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Yeah.  I've found this new feature useful multiple times already,
> > but the '#' icon is as non-mnemonic and unobvious as could possibly
> > be.  OTOH, I don't know of a standard icon for this feature.
>
> I also find it useful and certainly don't want it to disappear.
>

+1. I have also already found it useful.

> There's a unicode character for it.
> https://www.unicodepedia.com/unicode/miscellaneous-symbols-and-pictographs/1f517/link-symbol/
>

+1 for that and a "Link to this heading" tooltip.

Regards,
Dean





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 07:46  Daniel Gustafsson <daniel@yesql.se>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 2 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-07-18 07:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 18 Jul 2024, at 07:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Yeah.  I've found this new feature useful multiple times already,
> but the '#' icon is as non-mnemonic and unobvious as could possibly
> be.  OTOH, I don't know of a standard icon for this feature.

While not a standard the pilcrow [0] is, AFAICT from a bit of looking at other
docs, commonly used for this.  There is a lot of variability though so
whichever we choose it will be wrong one for someone.

--
Daniel Gustafsson

[0] https://en.wikipedia.org/wiki/Pilcrow




^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 09:16  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 0 replies; 36+ messages in thread

From: David Rowley @ 2024-07-18 09:16 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 18 Jul 2024 at 19:46, Daniel Gustafsson <daniel@yesql.se> wrote:
> There is a lot of variability though so
> whichever we choose it will be wrong one for someone.

I think the tooltip would help reduce the chances of someone being
confused.  For an example, see [1].

David

[1] https://devblogs.microsoft.com/cppblog/accelerating-compute-intensive-workloads-with-intel-avx-512/#...





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 13:49  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 36+ messages in thread

From: Tom Lane @ 2024-07-18 13:49 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

Daniel Gustafsson <daniel@yesql.se> writes:
> While not a standard the pilcrow [0] is, AFAICT from a bit of looking at other
> docs, commonly used for this.  There is a lot of variability though so
> whichever we choose it will be wrong one for someone.

I like this suggestion better because that's U+00B6, ie part of
LATIN-1, so it's *far* more likely to render correctly everywhere
than U+01F517 is.  We could also consider the section sign §
(U+00A7).

In any case, a tooltip would help reduce confusion.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 17:59  Daniel Gustafsson <daniel@yesql.se>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-07-18 17:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 18 Jul 2024, at 15:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Daniel Gustafsson <daniel@yesql.se> writes:
>> While not a standard the pilcrow [0] is, AFAICT from a bit of looking at other
>> docs, commonly used for this.  There is a lot of variability though so
>> whichever we choose it will be wrong one for someone.
> 
> I like this suggestion better because that's U+00B6, ie part of
> LATIN-1, so it's *far* more likely to render correctly everywhere
> than U+01F517 is.  We could also consider the section sign §
> (U+00A7).
> 
> In any case, a tooltip would help reduce confusion.

Looking a bit closer, the Python documentation does just this, a pilcrow with a
tool-tip ("Link to this heading") when hovering over it

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 18:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 0 replies; 36+ messages in thread

From: Tom Lane @ 2024-07-18 18:03 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

Daniel Gustafsson <daniel@yesql.se> writes:
> Looking a bit closer, the Python documentation does just this, a pilcrow with a
> tool-tip ("Link to this heading") when hovering over it

Oh nice --- a precedent!  And one that a fair number of people
will have seen before.  +1 for copying Python.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-07-18 18:03  Jonathan S. Katz <jkatz@postgresql.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 36+ messages in thread

From: Jonathan S. Katz @ 2024-07-18 18:03 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David Rowley <dgrowleyml@gmail.com>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On 7/18/24 1:59 PM, Daniel Gustafsson wrote:
>> On 18 Jul 2024, at 15:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Daniel Gustafsson <daniel@yesql.se> writes:
>>> While not a standard the pilcrow [0] is, AFAICT from a bit of looking at other
>>> docs, commonly used for this.  There is a lot of variability though so
>>> whichever we choose it will be wrong one for someone.
>>
>> I like this suggestion better because that's U+00B6, ie part of
>> LATIN-1, so it's *far* more likely to render correctly everywhere
>> than U+01F517 is.  We could also consider the section sign §
>> (U+00A7).
>>
>> In any case, a tooltip would help reduce confusion.
> 
> Looking a bit closer, the Python documentation does just this, a pilcrow with a
> tool-tip ("Link to this heading") when hovering over it

I forgot why we went with the "#" and not the (TIL the name) pilcrow 
symbol, but I'm generally used to seeing the pilcrow when I browse docs 
and may have voiced that at the time (though the record may show 
otherwise). So +1 to that.

Thanks,

Jonathan



Attachments:

  [application/pgp-signature] OpenPGP_signature.asc (839B, ../../c2e3bc0c-5717-4268-b4bd-c1b88a5c0799@postgresql.org/2-OpenPGP_signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-08-12 02:19  David Rowley <dgrowleyml@gmail.com>
  parent: Jonathan S. Katz <jkatz@postgresql.org>
  0 siblings, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-08-12 02:19 UTC (permalink / raw)
  To: Jonathan S. Katz <jkatz@postgresql.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Fri, 19 Jul 2024 at 06:03, Jonathan S. Katz <jkatz@postgresql.org> wrote:
>
> On 7/18/24 1:59 PM, Daniel Gustafsson wrote:
> > Looking a bit closer, the Python documentation does just this, a pilcrow with a
> > tool-tip ("Link to this heading") when hovering over it
>
> I forgot why we went with the "#" and not the (TIL the name) pilcrow
> symbol, but I'm generally used to seeing the pilcrow when I browse docs
> and may have voiced that at the time (though the record may show
> otherwise). So +1 to that.

I'm not really a web developer, but I did have a go at adjusting the
.css file so we show some relevant tooltip text. I was reminded about
this when looking at [1] this morning. That page is using '#' but the
purpose of it seems quite obvious when combined with the tooltip.

I've attached a small patch to adjust the CSS with hopes that it might
inspire someone who actually knows what they're doing with CSS to make
it better.

David

[1] https://stackoverflow.blog/2024/07/24/developers-want-more-more-more-the-2024-results-from-stack-ove...

Attachments:

  [application/octet-stream] add_tooltip_to_heading_links.patch (620B, ../../CAApHDvo1Qe-XZMczwSBcEkJUP6FdRA0YpeY2Pq6SgDe_b8Sgag@mail.gmail.com/2-add_tooltip_to_heading_links.patch)
  download | inline diff:
diff --git a/doc/src/sgml/stylesheet.css b/doc/src/sgml/stylesheet.css
index 86a8edb926..866636eccf 100644
--- a/doc/src/sgml/stylesheet.css
+++ b/doc/src/sgml/stylesheet.css
@@ -175,6 +175,20 @@ acronym		{ font-style: inherit; }
 a.id_link {
 	color: inherit;
 	visibility: hidden;
+	text-decoration: none;
+}
+
+a.id_link:hover:after {
+	content: "Pemalink to this heading";
+	font-size: 10px;
+	font-weight: normal;
+	text-decoration: none;
+	border: 1px solid #444444;
+	text-align: center;
+	border-radius: 5px 5px 5px 5px;
+	padding: 5px 5px 5px 5px;
+	position: relative;
+	top: 20px;
 }
 
 *:hover > a.id_link {


^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-16 22:18  Bruce Momjian <bruce@momjian.us>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 2 replies; 36+ messages in thread

From: Bruce Momjian @ 2024-10-16 22:18 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org


Where are we on this?  I still see "#".

---------------------------------------------------------------------------

On Mon, Aug 12, 2024 at 02:19:06PM +1200, David Rowley wrote:
> On Fri, 19 Jul 2024 at 06:03, Jonathan S. Katz <jkatz@postgresql.org> wrote:
> >
> > On 7/18/24 1:59 PM, Daniel Gustafsson wrote:
> > > Looking a bit closer, the Python documentation does just this, a pilcrow with a
> > > tool-tip ("Link to this heading") when hovering over it
> >
> > I forgot why we went with the "#" and not the (TIL the name) pilcrow
> > symbol, but I'm generally used to seeing the pilcrow when I browse docs
> > and may have voiced that at the time (though the record may show
> > otherwise). So +1 to that.
> 
> I'm not really a web developer, but I did have a go at adjusting the
> .css file so we show some relevant tooltip text. I was reminded about
> this when looking at [1] this morning. That page is using '#' but the
> purpose of it seems quite obvious when combined with the tooltip.
> 
> I've attached a small patch to adjust the CSS with hopes that it might
> inspire someone who actually knows what they're doing with CSS to make
> it better.
> 
> David
> 
> [1] https://stackoverflow.blog/2024/07/24/developers-want-more-more-more-the-2024-results-from-stack-ove...

> diff --git a/doc/src/sgml/stylesheet.css b/doc/src/sgml/stylesheet.css
> index 86a8edb926..866636eccf 100644
> --- a/doc/src/sgml/stylesheet.css
> +++ b/doc/src/sgml/stylesheet.css
> @@ -175,6 +175,20 @@ acronym		{ font-style: inherit; }
>  a.id_link {
>  	color: inherit;
>  	visibility: hidden;
> +	text-decoration: none;
> +}
> +
> +a.id_link:hover:after {
> +	content: "Pemalink to this heading";
> +	font-size: 10px;
> +	font-weight: normal;
> +	text-decoration: none;
> +	border: 1px solid #444444;
> +	text-align: center;
> +	border-radius: 5px 5px 5px 5px;
> +	padding: 5px 5px 5px 5px;
> +	position: relative;
> +	top: 20px;
>  }
>  
>  *:hover > a.id_link {


-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  When a patient asks the doctor, "Am I going to die?", he means 
  "Am I going to die soon?"





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-16 22:37  David G. Johnston <david.g.johnston@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 36+ messages in thread

From: David G. Johnston @ 2024-10-16 22:37 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: David Rowley <dgrowleyml@gmail.com>; Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Wednesday, October 16, 2024, Bruce Momjian <bruce@momjian.us> wrote:

>
> Where are we on this?  I still see "#".
>
>
We should document what we are doing in Conventions.

The hover stuff is a nice usability add, if a bit limited on mobile.

My +1 as well to matching Python with the pilcrow symbol.

David J.

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-16 23:24  David Rowley <dgrowleyml@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-10-16 23:24 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Jonathan S. Katz <jkatz@postgresql.org>; Daniel Gustafsson <daniel@yesql.se>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 17 Oct 2024 at 11:19, Bruce Momjian <bruce@momjian.us> wrote:
> Where are we on this?  I still see "#".

I was hoping for some voting for or against my patch or the general idea of it.

Also, my web skills in this area amount to trial and error, so it
would also be good to have someone who knows what they're doing have a
look at it.

David





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-17 07:20  Daniel Gustafsson <daniel@yesql.se>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 36+ messages in thread

From: Daniel Gustafsson @ 2024-10-17 07:20 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 17 Oct 2024, at 01:24, David Rowley <dgrowleyml@gmail.com> wrote:
> 
> On Thu, 17 Oct 2024 at 11:19, Bruce Momjian <bruce@momjian.us> wrote:
>> Where are we on this?  I still see "#".
> 
> I was hoping for some voting for or against my patch or the general idea of it.

Sorry for the delay, this fell off the inbox-radar. I am in favour of it.

> Also, my web skills in this area amount to trial and error, so it
> would also be good to have someone who knows what they're doing have a
> look at it.

+	content: "Pemalink to this heading";
s/Pema/Perma/

My main concern is that the relative positioning will push it off screen with a
break on smaller viewports (like phones).

I was trying to improve on it but didn't succeed, my web-skills amount to very
little so it might be a case of a blind leading a blind here =) Maybe if it's
placed in a Z position where it's rendered on top of the other content (to keep
it from adding vertical scroll) and using absolute positioning anchored on the
<h2> tag?  That would require the h2 to use a position: attribute though.

--
Daniel Gustafsson

Attachments:

  [image/png] Screenshot 2024-10-17 at 09.09.02.png (96.4K, ../../CAB1E5F6-340C-4703-9C82-AEF78FD76794@yesql.se/2-Screenshot%202024-10-17%20at%2009.09.02.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-29 11:31  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-10-29 11:31 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 17 Oct 2024 at 20:20, Daniel Gustafsson <daniel@yesql.se> wrote:
> My main concern is that the relative positioning will push it off screen with a
> break on smaller viewports (like phones).

I can recreate what you sent in the screenshot, but I have to make my
browser window as small as it will go and adjust the browser scaling
to at least 150%. I don't know how to hover over a link on my phone to
get tooltips to appear. Is it even possible? I tried hovering over it
with my left finger, but it didn't work ;)

> I was trying to improve on it but didn't succeed, my web-skills amount to very
> little so it might be a case of a blind leading a blind here =) Maybe if it's
> placed in a Z position where it's rendered on top of the other content (to keep
> it from adding vertical scroll) and using absolute positioning anchored on the
> <h2> tag?  That would require the h2 to use a position: attribute though.

I don't know. I've attached the CSS and an example HTML file if that
makes it easier for someone with the knowledge to play around with it.
For anyone who wants to try it, the CSS class of interest starts at
line 181 of the .css file.

I tried using the overflow property [0], but it didn't seem to behave
like I wanted it to. Setting it to "hidden" only seems to work
sometimes on Chrome. Not sure if that's a browser or user problem.

I tried to recreate the same wrapping issue you demonstrated with [1],
but their tooltip text does not enlarge with browser scaling, and
using browser scaling is the only way I can recreate the wrapping
issue you mentioned. I'm not sure how to make the CSS class's text
size immune to the effects of browser scaling.

One other difference in [1] vs what we have is that they put the # on
the left of the heading. There's less chance of having horizontal
wrapping issues when the mouse cursor is over on the left side.
However, we don't seem to have much of a margin for doing that.

David

[0] https://www.w3schools.com/css/css_overflow.asp
[1] https://stackoverflow.blog/2024/07/24/developers-want-more-more-more-the-2024-results-from-stack-ove...

Attachments:

  [text/html] using-explain.html (52.7K, ../../CAApHDvrZD4kyp7jyc=-G4HqbCgXzPpa5eNk-5T8yZbduOqaEnw@mail.gmail.com/2-using-explain.html)
  download | inline:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>14.1. Using EXPLAIN</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="performance-tips.html" title="Chapter 14. Performance Tips" /><link rel="next" href="planner-stats.html" title="14.2. Statistics Used by the Planner" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">14.1. Using <code class="command">EXPLAIN</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="performance-tips.html" title="Chapter 14. Performance Tips">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="performance-tips.html" title="Chapter 14. Performance Tips">Up</a></td><th width="60%" align="center">Chapter 14. Performance Tips</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18devel Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="planner-stats.html" title="14.2. Statistics Used by the Planner">Next</a></td></tr></table><hr /></div><div class="sect1" id="USING-EXPLAIN"><div class="titlepage"><div><div><h2 class="title" style="clear: both">14.1. Using <code class="command">EXPLAIN</code> <a href="#USING-EXPLAIN" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="using-explain.html#USING-EXPLAIN-BASICS">14.1.1. <code class="command">EXPLAIN</code> Basics</a></span></dt><dt><span class="sect2"><a href="using-explain.html#USING-EXPLAIN-ANALYZE">14.1.2. <code class="command">EXPLAIN ANALYZE</code></a></span></dt><dt><span class="sect2"><a href="using-explain.html#USING-EXPLAIN-CAVEATS">14.1.3. Caveats</a></span></dt></dl></div><a id="id-1.5.13.4.2" class="indexterm"></a><a id="id-1.5.13.4.3" class="indexterm"></a><p>
    <span class="productname">PostgreSQL</span> devises a <em class="firstterm">query
    plan</em> for each query it receives.  Choosing the right
    plan to match the query structure and the properties of the data
    is absolutely critical for good performance, so the system includes
    a complex <em class="firstterm">planner</em> that tries to choose good plans.
    You can use the <a class="link" href="sql-explain.html" title="EXPLAIN"><code class="command">EXPLAIN</code></a> command
    to see what query plan the planner creates for any query.
    Plan-reading is an art that requires some experience to master,
    but this section attempts to cover the basics.
   </p><p>
    Examples in this section are drawn from the regression test database
    after doing a <code class="command">VACUUM ANALYZE</code>, using v17 development sources.
    You should be able to get similar results if you try the examples
    yourself, but your estimated costs and row counts might vary slightly
    because <code class="command">ANALYZE</code>'s statistics are random samples rather
    than exact, and because costs are inherently somewhat platform-dependent.
   </p><p>
    The examples use <code class="command">EXPLAIN</code>'s default <span class="quote">“<span class="quote">text</span>”</span> output
    format, which is compact and convenient for humans to read.
    If you want to feed <code class="command">EXPLAIN</code>'s output to a program for further
    analysis, you should use one of its machine-readable output formats
    (XML, JSON, or YAML) instead.
   </p><div class="sect2" id="USING-EXPLAIN-BASICS"><div class="titlepage"><div><div><h3 class="title">14.1.1. <code class="command">EXPLAIN</code> Basics <a href="#USING-EXPLAIN-BASICS" class="id_link">#</a></h3></div></div></div><p>
    The structure of a query plan is a tree of <em class="firstterm">plan nodes</em>.
    Nodes at the bottom level of the tree are scan nodes: they return raw rows
    from a table.  There are different types of scan nodes for different
    table access methods: sequential scans, index scans, and bitmap index
    scans.  There are also non-table row sources, such as <code class="literal">VALUES</code>
    clauses and set-returning functions in <code class="literal">FROM</code>, which have their
    own scan node types.
    If the query requires joining, aggregation, sorting, or other
    operations on the raw rows, then there will be additional nodes
    above the scan nodes to perform these operations.  Again,
    there is usually more than one possible way to do these operations,
    so different node types can appear here too.  The output
    of <code class="command">EXPLAIN</code> has one line for each node in the plan
    tree, showing the basic node type plus the cost estimates that the planner
    made for the execution of that plan node.  Additional lines might appear,
    indented from the node's summary line,
    to show additional properties of the node.
    The very first line (the summary line for the topmost
    node) has the estimated total execution cost for the plan; it is this
    number that the planner seeks to minimize.
   </p><p>
    Here is a trivial example, just to show what the output looks like:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1;

                         QUERY PLAN
-------------------------------------------------------------
 Seq Scan on tenk1  (cost=0.00..445.00 rows=10000 width=244)
</pre><p>
   </p><p>
    Since this query has no <code class="literal">WHERE</code> clause, it must scan all the
    rows of the table, so the planner has chosen to use a simple sequential
    scan plan.  The numbers that are quoted in parentheses are (left
    to right):

    </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
       Estimated start-up cost.  This is the time expended before the output
       phase can begin, e.g., time to do the sorting in a sort node.
      </p></li><li class="listitem"><p>
       Estimated total cost.  This is stated on the assumption that the plan
       node is run to completion, i.e., all available rows are retrieved.
       In practice a node's parent node might stop short of reading all
       available rows (see the <code class="literal">LIMIT</code> example below).
      </p></li><li class="listitem"><p>
       Estimated number of rows output by this plan node.  Again, the node
       is assumed to be run to completion.
      </p></li><li class="listitem"><p>
       Estimated average width of rows output by this plan node (in bytes).
      </p></li></ul></div><p>
   </p><p>
    The costs are measured in arbitrary units determined by the planner's
    cost parameters (see <a class="xref" href="runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS" title="19.7.2. Planner Cost Constants">Section 19.7.2</a>).
    Traditional practice is to measure the costs in units of disk page
    fetches; that is, <a class="xref" href="runtime-config-query.html#GUC-SEQ-PAGE-COST">seq_page_cost</a> is conventionally
    set to <code class="literal">1.0</code> and the other cost parameters are set relative
    to that.  The examples in this section are run with the default cost
    parameters.
   </p><p>
    It's important to understand that the cost of an upper-level node includes
    the cost of all its child nodes.  It's also important to realize that
    the cost only reflects things that the planner cares about.
    In particular, the cost does not consider the time spent to convert
    output values to text form or to transmit them to the client, which
    could be important factors in the real elapsed time; but the planner
    ignores those costs because it cannot change them by altering the
    plan.  (Every correct plan will output the same row set, we trust.)
   </p><p>
    The <code class="literal">rows</code> value is a little tricky because it is
    not the number of rows processed or scanned by the
    plan node, but rather the number emitted by the node.  This is often
    less than the number scanned, as a result of filtering by any
    <code class="literal">WHERE</code>-clause conditions that are being applied at the node.
    Ideally the top-level rows estimate will approximate the number of rows
    actually returned, updated, or deleted by the query.
   </p><p>
    Returning to our example:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1;

                         QUERY PLAN
-------------------------------------------------------------
 Seq Scan on tenk1  (cost=0.00..445.00 rows=10000 width=244)
</pre><p>
   </p><p>
    These numbers are derived very straightforwardly.  If you do:

</p><pre class="programlisting">
SELECT relpages, reltuples FROM pg_class WHERE relname = 'tenk1';
</pre><p>

    you will find that <code class="classname">tenk1</code> has 345 disk
    pages and 10000 rows.  The estimated cost is computed as (disk pages read *
    <a class="xref" href="runtime-config-query.html#GUC-SEQ-PAGE-COST">seq_page_cost</a>) + (rows scanned *
    <a class="xref" href="runtime-config-query.html#GUC-CPU-TUPLE-COST">cpu_tuple_cost</a>).  By default,
    <code class="varname">seq_page_cost</code> is 1.0 and <code class="varname">cpu_tuple_cost</code> is 0.01,
    so the estimated cost is (345 * 1.0) + (10000 * 0.01) = 445.
   </p><p>
    Now let's modify the query to add a <code class="literal">WHERE</code> condition:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 7000;

                         QUERY PLAN
------------------------------------------------------------
 Seq Scan on tenk1  (cost=0.00..470.00 rows=7000 width=244)
   Filter: (unique1 &lt; 7000)
</pre><p>

    Notice that the <code class="command">EXPLAIN</code> output shows the <code class="literal">WHERE</code>
    clause being applied as a <span class="quote">“<span class="quote">filter</span>”</span> condition attached to the Seq
    Scan plan node.  This means that
    the plan node checks the condition for each row it scans, and outputs
    only the ones that pass the condition.
    The estimate of output rows has been reduced because of the
    <code class="literal">WHERE</code> clause.
    However, the scan will still have to visit all 10000 rows, so the cost
    hasn't decreased; in fact it has gone up a bit (by 10000 * <a class="xref" href="runtime-config-query.html#GUC-CPU-OPERATOR-COST">cpu_operator_cost</a>, to be exact) to reflect the extra CPU
    time spent checking the <code class="literal">WHERE</code> condition.
   </p><p>
    The actual number of rows this query would select is 7000, but the <code class="literal">rows</code>
    estimate is only approximate.  If you try to duplicate this experiment,
    you may well get a slightly different estimate; moreover, it can
    change after each <code class="command">ANALYZE</code> command, because the
    statistics produced by <code class="command">ANALYZE</code> are taken from a
    randomized sample of the table.
   </p><p>
    Now, let's make the condition more restrictive:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100;

                                  QUERY PLAN
-------------------------------------------------------------------​-----------
 Bitmap Heap Scan on tenk1  (cost=5.06..224.98 rows=100 width=244)
   Recheck Cond: (unique1 &lt; 100)
   -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)
         Index Cond: (unique1 &lt; 100)
</pre><p>

    Here the planner has decided to use a two-step plan: the child plan
    node visits an index to find the locations of rows matching the index
    condition, and then the upper plan node actually fetches those rows
    from the table itself.  Fetching rows separately is much more
    expensive than reading them sequentially, but because not all the pages
    of the table have to be visited, this is still cheaper than a sequential
    scan.  (The reason for using two plan levels is that the upper plan
    node sorts the row locations identified by the index into physical order
    before reading them, to minimize the cost of separate fetches.
    The <span class="quote">“<span class="quote">bitmap</span>”</span> mentioned in the node names is the mechanism that
    does the sorting.)
   </p><p>
    Now let's add another condition to the <code class="literal">WHERE</code> clause:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND stringu1 = 'xxx';

                                  QUERY PLAN
-------------------------------------------------------------------​-----------
 Bitmap Heap Scan on tenk1  (cost=5.04..225.20 rows=1 width=244)
   Recheck Cond: (unique1 &lt; 100)
   Filter: (stringu1 = 'xxx'::name)
   -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)
         Index Cond: (unique1 &lt; 100)
</pre><p>

    The added condition <code class="literal">stringu1 = 'xxx'</code> reduces the
    output row count estimate, but not the cost because we still have to visit
    the same set of rows.  That's because the <code class="literal">stringu1</code> clause
    cannot be applied as an index condition, since this index is only on
    the <code class="literal">unique1</code> column.  Instead it is applied as a filter on
    the rows retrieved using the index.  Thus the cost has actually gone up
    slightly to reflect this extra checking.
   </p><p>
    In some cases the planner will prefer a <span class="quote">“<span class="quote">simple</span>”</span> index scan plan:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 = 42;

                                 QUERY PLAN
-------------------------------------------------------------------​----------
 Index Scan using tenk1_unique1 on tenk1  (cost=0.29..8.30 rows=1 width=244)
   Index Cond: (unique1 = 42)
</pre><p>

    In this type of plan the table rows are fetched in index order, which
    makes them even more expensive to read, but there are so few that the
    extra cost of sorting the row locations is not worth it.  You'll most
    often see this plan type for queries that fetch just a single row.  It's
    also often used for queries that have an <code class="literal">ORDER BY</code> condition
    that matches the index order, because then no extra sorting step is needed
    to satisfy the <code class="literal">ORDER BY</code>.  In this example, adding
    <code class="literal">ORDER BY unique1</code> would use the same plan because the
    index already implicitly provides the requested ordering.
   </p><p>
     The planner may implement an <code class="literal">ORDER BY</code> clause in several
     ways.  The above example shows that such an ordering clause may be
     implemented implicitly.  The planner may also add an explicit
     <code class="literal">Sort</code> step:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 ORDER BY unique1;

                            QUERY PLAN
-------------------------------------------------------------------
 Sort  (cost=1109.39..1134.39 rows=10000 width=244)
   Sort Key: unique1
   -&gt;  Seq Scan on tenk1  (cost=0.00..445.00 rows=10000 width=244)
</pre><p>

    If a part of the plan guarantees an ordering on a prefix of the
    required sort keys, then the planner may instead decide to use an
    <code class="literal">Incremental Sort</code> step:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 ORDER BY hundred, ten LIMIT 100;

                                              QUERY PLAN
-------------------------------------------------------------------​-----------------------------
 Limit  (cost=19.35..39.49 rows=100 width=244)
   -&gt;  Incremental Sort  (cost=19.35..2033.39 rows=10000 width=244)
         Sort Key: hundred, ten
         Presorted Key: hundred
         -&gt;  Index Scan using tenk1_hundred on tenk1  (cost=0.29..1574.20 rows=10000 width=244)
</pre><p>

    Compared to regular sorts, sorting incrementally allows returning tuples
    before the entire result set has been sorted, which particularly enables
    optimizations with <code class="literal">LIMIT</code> queries.  It may also reduce
    memory usage and the likelihood of spilling sorts to disk, but it comes at
    the cost of the increased overhead of splitting the result set into multiple
    sorting batches.
   </p><p>
    If there are separate indexes on several of the columns referenced
    in <code class="literal">WHERE</code>, the planner might choose to use an AND or OR
    combination of the indexes:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000;

                                     QUERY PLAN
-------------------------------------------------------------------​------------------
 Bitmap Heap Scan on tenk1  (cost=25.07..60.11 rows=10 width=244)
   Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000))
   -&gt;  BitmapAnd  (cost=25.07..25.07 rows=10 width=0)
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)
               Index Cond: (unique1 &lt; 100)
         -&gt;  Bitmap Index Scan on tenk1_unique2  (cost=0.00..19.78 rows=999 width=0)
               Index Cond: (unique2 &gt; 9000)
</pre><p>

    But this requires visiting both indexes, so it's not necessarily a win
    compared to using just one index and treating the other condition as
    a filter.  If you vary the ranges involved you'll see the plan change
    accordingly.
   </p><p>
    Here is an example showing the effects of <code class="literal">LIMIT</code>:

</p><pre class="screen">
EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2;

                                     QUERY PLAN
-------------------------------------------------------------------​------------------
 Limit  (cost=0.29..14.28 rows=2 width=244)
   -&gt;  Index Scan using tenk1_unique2 on tenk1  (cost=0.29..70.27 rows=10 width=244)
         Index Cond: (unique2 &gt; 9000)
         Filter: (unique1 &lt; 100)
</pre><p>
   </p><p>
    This is the same query as above, but we added a <code class="literal">LIMIT</code> so that
    not all the rows need be retrieved, and the planner changed its mind about
    what to do.  Notice that the total cost and row count of the Index Scan
    node are shown as if it were run to completion.  However, the Limit node
    is expected to stop after retrieving only a fifth of those rows, so its
    total cost is only a fifth as much, and that's the actual estimated cost
    of the query.  This plan is preferred over adding a Limit node to the
    previous plan because the Limit could not avoid paying the startup cost
    of the bitmap scan, so the total cost would be something over 25 units
    with that approach.
   </p><p>
    Let's try joining two tables, using the columns we have been discussing:

</p><pre class="screen">
EXPLAIN SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2;

                                      QUERY PLAN
-------------------------------------------------------------------​-------------------
 Nested Loop  (cost=4.65..118.50 rows=10 width=488)
   -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=4.36..39.38 rows=10 width=244)
         Recheck Cond: (unique1 &lt; 10)
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..4.36 rows=10 width=0)
               Index Cond: (unique1 &lt; 10)
   -&gt;  Index Scan using tenk2_unique2 on tenk2 t2  (cost=0.29..7.90 rows=1 width=244)
         Index Cond: (unique2 = t1.unique2)
</pre><p>
   </p><p>
    In this plan, we have a nested-loop join node with two table scans as
    inputs, or children.  The indentation of the node summary lines reflects
    the plan tree structure.  The join's first, or <span class="quote">“<span class="quote">outer</span>”</span>, child
    is a bitmap scan similar to those we saw before.  Its cost and row count
    are the same as we'd get from <code class="literal">SELECT ... WHERE unique1 &lt; 10</code>
    because we are
    applying the <code class="literal">WHERE</code> clause <code class="literal">unique1 &lt; 10</code>
    at that node.
    The <code class="literal">t1.unique2 = t2.unique2</code> clause is not relevant yet,
    so it doesn't affect the row count of the outer scan.  The nested-loop
    join node will run its second,
    or <span class="quote">“<span class="quote">inner</span>”</span> child once for each row obtained from the outer child.
    Column values from the current outer row can be plugged into the inner
    scan; here, the <code class="literal">t1.unique2</code> value from the outer row is available,
    so we get a plan and costs similar to what we saw above for a simple
    <code class="literal">SELECT ... WHERE t2.unique2 = <em class="replaceable"><code>constant</code></em></code> case.
    (The estimated cost is actually a bit lower than what was seen above,
    as a result of caching that's expected to occur during the repeated
    index scans on <code class="literal">t2</code>.)  The
    costs of the loop node are then set on the basis of the cost of the outer
    scan, plus one repetition of the inner scan for each outer row (10 * 7.90,
    here), plus a little CPU time for join processing.
   </p><p>
    In this example the join's output row count is the same as the product
    of the two scans' row counts, but that's not true in all cases because
    there can be additional <code class="literal">WHERE</code> clauses that mention both tables
    and so can only be applied at the join point, not to either input scan.
    Here's an example:

</p><pre class="screen">
EXPLAIN SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t2.unique2 &lt; 10 AND t1.hundred &lt; t2.hundred;

                                         QUERY PLAN
-------------------------------------------------------------------​--------------------------
 Nested Loop  (cost=4.65..49.36 rows=33 width=488)
   Join Filter: (t1.hundred &lt; t2.hundred)
   -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=4.36..39.38 rows=10 width=244)
         Recheck Cond: (unique1 &lt; 10)
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..4.36 rows=10 width=0)
               Index Cond: (unique1 &lt; 10)
   -&gt;  Materialize  (cost=0.29..8.51 rows=10 width=244)
         -&gt;  Index Scan using tenk2_unique2 on tenk2 t2  (cost=0.29..8.46 rows=10 width=244)
               Index Cond: (unique2 &lt; 10)
</pre><p>

    The condition <code class="literal">t1.hundred &lt; t2.hundred</code> can't be
    tested in the <code class="literal">tenk2_unique2</code> index, so it's applied at the
    join node.  This reduces the estimated output row count of the join node,
    but does not change either input scan.
   </p><p>
    Notice that here the planner has chosen to <span class="quote">“<span class="quote">materialize</span>”</span> the inner
    relation of the join, by putting a Materialize plan node atop it.  This
    means that the <code class="literal">t2</code> index scan will be done just once, even
    though the nested-loop join node needs to read that data ten times, once
    for each row from the outer relation.  The Materialize node saves the data
    in memory as it's read, and then returns the data from memory on each
    subsequent pass.
   </p><p>
    When dealing with outer joins, you might see join plan nodes with both
    <span class="quote">“<span class="quote">Join Filter</span>”</span> and plain <span class="quote">“<span class="quote">Filter</span>”</span> conditions attached.
    Join Filter conditions come from the outer join's <code class="literal">ON</code> clause,
    so a row that fails the Join Filter condition could still get emitted as
    a null-extended row.  But a plain Filter condition is applied after the
    outer-join rules and so acts to remove rows unconditionally.  In an inner
    join there is no semantic difference between these types of filters.
   </p><p>
    If we change the query's selectivity a bit, we might get a very different
    join plan:

</p><pre class="screen">
EXPLAIN SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;

                                        QUERY PLAN
-------------------------------------------------------------------​-----------------------
 Hash Join  (cost=226.23..709.73 rows=100 width=488)
   Hash Cond: (t2.unique2 = t1.unique2)
   -&gt;  Seq Scan on tenk2 t2  (cost=0.00..445.00 rows=10000 width=244)
   -&gt;  Hash  (cost=224.98..224.98 rows=100 width=244)
         -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=5.06..224.98 rows=100 width=244)
               Recheck Cond: (unique1 &lt; 100)
               -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)
                     Index Cond: (unique1 &lt; 100)
</pre><p>
   </p><p>
    Here, the planner has chosen to use a hash join, in which rows of one
    table are entered into an in-memory hash table, after which the other
    table is scanned and the hash table is probed for matches to each row.
    Again note how the indentation reflects the plan structure: the bitmap
    scan on <code class="literal">tenk1</code> is the input to the Hash node, which constructs
    the hash table.  That's then returned to the Hash Join node, which reads
    rows from its outer child plan and searches the hash table for each one.
   </p><p>
    Another possible type of join is a merge join, illustrated here:

</p><pre class="screen">
EXPLAIN SELECT *
FROM tenk1 t1, onek t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;

                                        QUERY PLAN
-------------------------------------------------------------------​-----------------------
 Merge Join  (cost=0.56..233.49 rows=10 width=488)
   Merge Cond: (t1.unique2 = t2.unique2)
   -&gt;  Index Scan using tenk1_unique2 on tenk1 t1  (cost=0.29..643.28 rows=100 width=244)
         Filter: (unique1 &lt; 100)
   -&gt;  Index Scan using onek_unique2 on onek t2  (cost=0.28..166.28 rows=1000 width=244)
</pre><p>
   </p><p>
    Merge join requires its input data to be sorted on the join keys.  In this
    example each input is sorted by using an index scan to visit the rows
    in the correct order; but a sequential scan and sort could also be used.
    (Sequential-scan-and-sort frequently beats an index scan for sorting many rows,
    because of the nonsequential disk access required by the index scan.)
   </p><p>
    One way to look at variant plans is to force the planner to disregard
    whatever strategy it thought was the cheapest, using the enable/disable
    flags described in <a class="xref" href="runtime-config-query.html#RUNTIME-CONFIG-QUERY-ENABLE" title="19.7.1. Planner Method Configuration">Section 19.7.1</a>.
    (This is a crude tool, but useful.  See
    also <a class="xref" href="explicit-joins.html" title="14.3. Controlling the Planner with Explicit JOIN Clauses">Section 14.3</a>.)
    For example, if we're unconvinced that merge join is the best join
    type for the previous example, we could try

</p><pre class="screen">
SET enable_mergejoin = off;

EXPLAIN SELECT *
FROM tenk1 t1, onek t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2;

                                        QUERY PLAN
-------------------------------------------------------------------​-----------------------
 Hash Join  (cost=226.23..344.08 rows=10 width=488)
   Hash Cond: (t2.unique2 = t1.unique2)
   -&gt;  Seq Scan on onek t2  (cost=0.00..114.00 rows=1000 width=244)
   -&gt;  Hash  (cost=224.98..224.98 rows=100 width=244)
         -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=5.06..224.98 rows=100 width=244)
               Recheck Cond: (unique1 &lt; 100)
               -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0)
                     Index Cond: (unique1 &lt; 100)
</pre><p>

    which shows that the planner thinks that hash join would be nearly 50%
    more expensive than merge join for this case.
    Of course, the next question is whether it's right about that.
    We can investigate that using <code class="command">EXPLAIN ANALYZE</code>, as
    discussed <a class="link" href="using-explain.html#USING-EXPLAIN-ANALYZE" title="14.1.2. EXPLAIN ANALYZE">below</a>.
   </p><p>
    <a id="id-1.5.13.4.7.29.1" class="indexterm"></a>
    Some query plans involve <em class="firstterm">subplans</em>, which arise
    from sub-<code class="literal">SELECT</code>s in the original query.  Such
    queries can sometimes be transformed into ordinary join plans, but
    when they cannot be, we get plans like:

</p><pre class="screen">
EXPLAIN VERBOSE SELECT unique1
FROM tenk1 t
WHERE t.ten &lt; ALL (SELECT o.ten FROM onek o WHERE o.four = t.four);

                               QUERY PLAN
-------------------------------------------------------------------​------
 Seq Scan on public.tenk1 t  (cost=0.00..586095.00 rows=5000 width=4)
   Output: t.unique1
   Filter: (ALL (t.ten &lt; (SubPlan 1).col1))
   SubPlan 1
     -&gt;  Seq Scan on public.onek o  (cost=0.00..116.50 rows=250 width=4)
           Output: o.ten
           Filter: (o.four = t.four)
</pre><p>

    This rather artificial example serves to illustrate a couple of
    points: values from the outer plan level can be passed down into a
    subplan (here, <code class="literal">t.four</code> is passed down) and the
    results of the sub-select are available to the outer plan.  Those
    result values are shown by <code class="command">EXPLAIN</code> with notations
    like
    <code class="literal">(<em class="replaceable"><code>subplan_name</code></em>).col<em class="replaceable"><code>N</code></em></code>,
    which refers to the <em class="replaceable"><code>N</code></em>'th output column of
    the sub-<code class="literal">SELECT</code>.
   </p><p>
    <a id="id-1.5.13.4.7.30.1" class="indexterm"></a>
    In the example above, the <code class="literal">ALL</code> operator runs the
    subplan again for each row of the outer query (which accounts for the
    high estimated cost).  Some queries can use a <em class="firstterm">hashed
    subplan</em> to avoid that:

</p><pre class="screen">
EXPLAIN SELECT *
FROM tenk1 t
WHERE t.unique1 NOT IN (SELECT o.unique1 FROM onek o);

                                         QUERY PLAN
-------------------------------------------------------------------​-------------------------
 Seq Scan on tenk1 t  (cost=61.77..531.77 rows=5000 width=244)
   Filter: (NOT (ANY (unique1 = (hashed SubPlan 1).col1)))
   SubPlan 1
     -&gt;  Index Only Scan using onek_unique1 on onek o  (cost=0.28..59.27 rows=1000 width=4)
(4 rows)
</pre><p>

    Here, the subplan is run a single time and its output is loaded into
    an in-memory hash table, which is then probed by the
    outer <code class="literal">ANY</code> operator.  This requires that the
    sub-<code class="literal">SELECT</code> not reference any variables of the outer
    query, and that the <code class="literal">ANY</code>'s comparison operator be
    amenable to hashing.
   </p><p>
    <a id="id-1.5.13.4.7.31.1" class="indexterm"></a>
    If, in addition to not referencing any variables of the outer query,
    the sub-<code class="literal">SELECT</code> cannot return more than one row,
    it may instead be implemented as an <em class="firstterm">initplan</em>:

</p><pre class="screen">
EXPLAIN VERBOSE SELECT unique1
FROM tenk1 t1 WHERE t1.ten = (SELECT (random() * 10)::integer);

                             QUERY PLAN
------------------------------------------------------------​--------
 Seq Scan on public.tenk1 t1  (cost=0.02..470.02 rows=1000 width=4)
   Output: t1.unique1
   Filter: (t1.ten = (InitPlan 1).col1)
   InitPlan 1
     -&gt;  Result  (cost=0.00..0.02 rows=1 width=4)
           Output: ((random() * '10'::double precision))::integer
</pre><p>

    An initplan is run only once per execution of the outer plan, and its
    results are saved for re-use in later rows of the outer plan.  So in
    this example <code class="literal">random()</code> is evaluated only once and
    all the values of <code class="literal">t1.ten</code> are compared to the same
    randomly-chosen integer.  That's quite different from what would
    happen without the sub-<code class="literal">SELECT</code> construct.
   </p></div><div class="sect2" id="USING-EXPLAIN-ANALYZE"><div class="titlepage"><div><div><h3 class="title">14.1.2. <code class="command">EXPLAIN ANALYZE</code> <a href="#USING-EXPLAIN-ANALYZE" class="id_link">#</a></h3></div></div></div><p>
    It is possible to check the accuracy of the planner's estimates
    by using <code class="command">EXPLAIN</code>'s <code class="literal">ANALYZE</code> option.  With this
    option, <code class="command">EXPLAIN</code> actually executes the query, and then displays
    the true row counts and true run time accumulated within each plan node,
    along with the same estimates that a plain <code class="command">EXPLAIN</code>
    shows.  For example, we might get a result like this:

</p><pre class="screen">
EXPLAIN ANALYZE SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 10 AND t1.unique2 = t2.unique2;

                                                           QUERY PLAN
-------------------------------------------------------------------​--------------------------------------------------------------
 Nested Loop  (cost=4.65..118.50 rows=10 width=488) (actual time=0.017..0.051 rows=10 loops=1)
   -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=4.36..39.38 rows=10 width=244) (actual time=0.009..0.017 rows=10 loops=1)
         Recheck Cond: (unique1 &lt; 10)
         Heap Blocks: exact=10
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..4.36 rows=10 width=0) (actual time=0.004..0.004 rows=10 loops=1)
               Index Cond: (unique1 &lt; 10)
   -&gt;  Index Scan using tenk2_unique2 on tenk2 t2  (cost=0.29..7.90 rows=1 width=244) (actual time=0.003..0.003 rows=1 loops=10)
         Index Cond: (unique2 = t1.unique2)
 Planning Time: 0.485 ms
 Execution Time: 0.073 ms
</pre><p>

    Note that the <span class="quote">“<span class="quote">actual time</span>”</span> values are in milliseconds of
    real time, whereas the <code class="literal">cost</code> estimates are expressed in
    arbitrary units; so they are unlikely to match up.
    The thing that's usually most important to look for is whether the
    estimated row counts are reasonably close to reality.  In this example
    the estimates were all dead-on, but that's quite unusual in practice.
   </p><p>
    In some query plans, it is possible for a subplan node to be executed more
    than once.  For example, the inner index scan will be executed once per
    outer row in the above nested-loop plan.  In such cases, the
    <code class="literal">loops</code> value reports the
    total number of executions of the node, and the actual time and rows
    values shown are averages per-execution.  This is done to make the numbers
    comparable with the way that the cost estimates are shown.  Multiply by
    the <code class="literal">loops</code> value to get the total time actually spent in
    the node.  In the above example, we spent a total of 0.030 milliseconds
    executing the index scans on <code class="literal">tenk2</code>.
   </p><p>
    In some cases <code class="command">EXPLAIN ANALYZE</code> shows additional execution
    statistics beyond the plan node execution times and row counts.
    For example, Sort and Hash nodes provide extra information:

</p><pre class="screen">
EXPLAIN ANALYZE SELECT *
FROM tenk1 t1, tenk2 t2
WHERE t1.unique1 &lt; 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;

                                                                 QUERY PLAN
-------------------------------------------------------------------​-------------------------------------------------------------------​------
 Sort  (cost=713.05..713.30 rows=100 width=488) (actual time=2.995..3.002 rows=100 loops=1)
   Sort Key: t1.fivethous
   Sort Method: quicksort  Memory: 74kB
   -&gt;  Hash Join  (cost=226.23..709.73 rows=100 width=488) (actual time=0.515..2.920 rows=100 loops=1)
         Hash Cond: (t2.unique2 = t1.unique2)
         -&gt;  Seq Scan on tenk2 t2  (cost=0.00..445.00 rows=10000 width=244) (actual time=0.026..1.790 rows=10000 loops=1)
         -&gt;  Hash  (cost=224.98..224.98 rows=100 width=244) (actual time=0.476..0.477 rows=100 loops=1)
               Buckets: 1024  Batches: 1  Memory Usage: 35kB
               -&gt;  Bitmap Heap Scan on tenk1 t1  (cost=5.06..224.98 rows=100 width=244) (actual time=0.030..0.450 rows=100 loops=1)
                     Recheck Cond: (unique1 &lt; 100)
                     Heap Blocks: exact=90
                     -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0) (actual time=0.013..0.013 rows=100 loops=1)
                           Index Cond: (unique1 &lt; 100)
 Planning Time: 0.187 ms
 Execution Time: 3.036 ms
</pre><p>

    The Sort node shows the sort method used (in particular, whether the sort
    was in-memory or on-disk) and the amount of memory or disk space needed.
    The Hash node shows the number of hash buckets and batches as well as the
    peak amount of memory used for the hash table.  (If the number of batches
    exceeds one, there will also be disk space usage involved, but that is not
    shown.)
   </p><p>
    Another type of extra information is the number of rows removed by a
    filter condition:

</p><pre class="screen">
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten &lt; 7;

                                               QUERY PLAN
-------------------------------------------------------------------​--------------------------------------
 Seq Scan on tenk1  (cost=0.00..470.00 rows=7000 width=244) (actual time=0.030..1.995 rows=7000 loops=1)
   Filter: (ten &lt; 7)
   Rows Removed by Filter: 3000
 Planning Time: 0.102 ms
 Execution Time: 2.145 ms
</pre><p>

    These counts can be particularly valuable for filter conditions applied at
    join nodes.  The <span class="quote">“<span class="quote">Rows Removed</span>”</span> line only appears when at least
    one scanned row, or potential join pair in the case of a join node,
    is rejected by the filter condition.
   </p><p>
    A case similar to filter conditions occurs with <span class="quote">“<span class="quote">lossy</span>”</span>
    index scans.  For example, consider this search for polygons containing a
    specific point:

</p><pre class="screen">
EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)';

                                              QUERY PLAN
-------------------------------------------------------------------​-----------------------------------
 Seq Scan on polygon_tbl  (cost=0.00..1.09 rows=1 width=85) (actual time=0.023..0.023 rows=0 loops=1)
   Filter: (f1 @&gt; '((0.5,2))'::polygon)
   Rows Removed by Filter: 7
 Planning Time: 0.039 ms
 Execution Time: 0.033 ms
</pre><p>

    The planner thinks (quite correctly) that this sample table is too small
    to bother with an index scan, so we have a plain sequential scan in which
    all the rows got rejected by the filter condition.  But if we force an
    index scan to be used, we see:

</p><pre class="screen">
SET enable_seqscan TO off;

EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @&gt; polygon '(0.5,2.0)';

                                                        QUERY PLAN
-------------------------------------------------------------------​-------------------------------------------------------
 Index Scan using gpolygonind on polygon_tbl  (cost=0.13..8.15 rows=1 width=85) (actual time=0.074..0.074 rows=0 loops=1)
   Index Cond: (f1 @&gt; '((0.5,2))'::polygon)
   Rows Removed by Index Recheck: 1
 Planning Time: 0.039 ms
 Execution Time: 0.098 ms
</pre><p>

    Here we can see that the index returned one candidate row, which was
    then rejected by a recheck of the index condition.  This happens because a
    GiST index is <span class="quote">“<span class="quote">lossy</span>”</span> for polygon containment tests: it actually
    returns the rows with polygons that overlap the target, and then we have
    to do the exact containment test on those rows.
   </p><p>
    <code class="command">EXPLAIN</code> has a <code class="literal">BUFFERS</code> option that can be used with
    <code class="literal">ANALYZE</code> to get even more run time statistics:

</p><pre class="screen">
EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000;

                                                           QUERY PLAN
-------------------------------------------------------------------​--------------------------------------------------------------
 Bitmap Heap Scan on tenk1  (cost=25.07..60.11 rows=10 width=244) (actual time=0.105..0.114 rows=10 loops=1)
   Recheck Cond: ((unique1 &lt; 100) AND (unique2 &gt; 9000))
   Heap Blocks: exact=10
   Buffers: shared hit=14 read=3
   -&gt;  BitmapAnd  (cost=25.07..25.07 rows=10 width=0) (actual time=0.100..0.101 rows=0 loops=1)
         Buffers: shared hit=4 read=3
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0) (actual time=0.027..0.027 rows=100 loops=1)
               Index Cond: (unique1 &lt; 100)
               Buffers: shared hit=2
         -&gt;  Bitmap Index Scan on tenk1_unique2  (cost=0.00..19.78 rows=999 width=0) (actual time=0.070..0.070 rows=999 loops=1)
               Index Cond: (unique2 &gt; 9000)
               Buffers: shared hit=2 read=3
 Planning:
   Buffers: shared hit=3
 Planning Time: 0.162 ms
 Execution Time: 0.143 ms
</pre><p>

    The numbers provided by <code class="literal">BUFFERS</code> help to identify which parts
    of the query are the most I/O-intensive.
   </p><p>
    Keep in mind that because <code class="command">EXPLAIN ANALYZE</code> actually
    runs the query, any side-effects will happen as usual, even though
    whatever results the query might output are discarded in favor of
    printing the <code class="command">EXPLAIN</code> data.  If you want to analyze a
    data-modifying query without changing your tables, you can
    roll the command back afterwards, for example:

</p><pre class="screen">
BEGIN;

EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 &lt; 100;

                                                           QUERY PLAN
-------------------------------------------------------------------​-------------------------------------------------------------
 Update on tenk1  (cost=5.06..225.23 rows=0 width=0) (actual time=1.634..1.635 rows=0 loops=1)
   -&gt;  Bitmap Heap Scan on tenk1  (cost=5.06..225.23 rows=100 width=10) (actual time=0.065..0.141 rows=100 loops=1)
         Recheck Cond: (unique1 &lt; 100)
         Heap Blocks: exact=90
         -&gt;  Bitmap Index Scan on tenk1_unique1  (cost=0.00..5.04 rows=100 width=0) (actual time=0.031..0.031 rows=100 loops=1)
               Index Cond: (unique1 &lt; 100)
 Planning Time: 0.151 ms
 Execution Time: 1.856 ms

ROLLBACK;
</pre><p>
   </p><p>
    As seen in this example, when the query is an <code class="command">INSERT</code>,
    <code class="command">UPDATE</code>, <code class="command">DELETE</code>, or
    <code class="command">MERGE</code> command, the actual work of
    applying the table changes is done by a top-level Insert, Update,
    Delete, or Merge plan node.  The plan nodes underneath this node perform
    the work of locating the old rows and/or computing the new data.
    So above, we see the same sort of bitmap table scan we've seen already,
    and its output is fed to an Update node that stores the updated rows.
    It's worth noting that although the data-modifying node can take a
    considerable amount of run time (here, it's consuming the lion's share
    of the time), the planner does not currently add anything to the cost
    estimates to account for that work.  That's because the work to be done is
    the same for every correct query plan, so it doesn't affect planning
    decisions.
   </p><p>
    When an <code class="command">UPDATE</code>, <code class="command">DELETE</code>, or
    <code class="command">MERGE</code> command affects a partitioned table or
    inheritance hierarchy, the output might look like this:

</p><pre class="screen">
EXPLAIN UPDATE gtest_parent SET f1 = CURRENT_DATE WHERE f2 = 101;

                                       QUERY PLAN
-------------------------------------------------------------------​---------------------
 Update on gtest_parent  (cost=0.00..3.06 rows=0 width=0)
   Update on gtest_child gtest_parent_1
   Update on gtest_child2 gtest_parent_2
   Update on gtest_child3 gtest_parent_3
   -&gt;  Append  (cost=0.00..3.06 rows=3 width=14)
         -&gt;  Seq Scan on gtest_child gtest_parent_1  (cost=0.00..1.01 rows=1 width=14)
               Filter: (f2 = 101)
         -&gt;  Seq Scan on gtest_child2 gtest_parent_2  (cost=0.00..1.01 rows=1 width=14)
               Filter: (f2 = 101)
         -&gt;  Seq Scan on gtest_child3 gtest_parent_3  (cost=0.00..1.01 rows=1 width=14)
               Filter: (f2 = 101)
</pre><p>

    In this example the Update node needs to consider three child tables,
    but not the originally-mentioned partitioned table (since that never
    stores any data).  So there are three input
    scanning subplans, one per table.  For clarity, the Update node is
    annotated to show the specific target tables that will be updated, in the
    same order as the corresponding subplans.
   </p><p>
    The <code class="literal">Planning time</code> shown by <code class="command">EXPLAIN
    ANALYZE</code> is the time it took to generate the query plan from the
    parsed query and optimize it. It does not include parsing or rewriting.
   </p><p>
    The <code class="literal">Execution time</code> shown by <code class="command">EXPLAIN
    ANALYZE</code> includes executor start-up and shut-down time, as well
    as the time to run any triggers that are fired, but it does not include
    parsing, rewriting, or planning time.
    Time spent executing <code class="literal">BEFORE</code> triggers, if any, is included in
    the time for the related Insert, Update, or Delete node; but time
    spent executing <code class="literal">AFTER</code> triggers is not counted there because
    <code class="literal">AFTER</code> triggers are fired after completion of the whole plan.
    The total time spent in each trigger
    (either <code class="literal">BEFORE</code> or <code class="literal">AFTER</code>) is also shown separately.
    Note that deferred constraint triggers will not be executed
    until end of transaction and are thus not considered at all by
    <code class="command">EXPLAIN ANALYZE</code>.
   </p><p>
    The time shown for the top-level node does not include any time needed
    to convert the query's output data into displayable form or to send it
    to the client.  While <code class="command">EXPLAIN ANALYZE</code> will never
    send the data to the client, it can be told to convert the query's
    output data to displayable form and measure the time needed for that,
    by specifying the <code class="literal">SERIALIZE</code> option.  That time will
    be shown separately, and it's also included in the
    total <code class="literal">Execution time</code>.
   </p></div><div class="sect2" id="USING-EXPLAIN-CAVEATS"><div class="titlepage"><div><div><h3 class="title">14.1.3. Caveats <a href="#USING-EXPLAIN-CAVEATS" class="id_link">#</a></h3></div></div></div><p>
    There are two significant ways in which run times measured by
    <code class="command">EXPLAIN ANALYZE</code> can deviate from normal execution of
    the same query.  First, since no output rows are delivered to the client,
    network transmission costs are not included.  I/O conversion costs are
    not included either unless <code class="literal">SERIALIZE</code> is specified.
    Second, the measurement overhead added by <code class="command">EXPLAIN
    ANALYZE</code> can be significant, especially on machines with slow
    <code class="function">gettimeofday()</code> operating-system calls. You can use the
    <a class="xref" href="pgtesttiming.html" title="pg_test_timing"><span class="refentrytitle"><span class="application">pg_test_timing</span></span></a> tool to measure the overhead of timing
    on your system.
   </p><p>
    <code class="command">EXPLAIN</code> results should not be extrapolated to situations
    much different from the one you are actually testing; for example,
    results on a toy-sized table cannot be assumed to apply to large tables.
    The planner's cost estimates are not linear and so it might choose
    a different plan for a larger or smaller table.  An extreme example
    is that on a table that only occupies one disk page, you'll nearly
    always get a sequential scan plan whether indexes are available or not.
    The planner realizes that it's going to take one disk page read to
    process the table in any case, so there's no value in expending additional
    page reads to look at an index.  (We saw this happening in the
    <code class="literal">polygon_tbl</code> example above.)
   </p><p>
    There are cases in which the actual and estimated values won't match up
    well, but nothing is really wrong.  One such case occurs when
    plan node execution is stopped short by a <code class="literal">LIMIT</code> or similar
    effect.  For example, in the <code class="literal">LIMIT</code> query we used before,

</p><pre class="screen">
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 &lt; 100 AND unique2 &gt; 9000 LIMIT 2;

                                                          QUERY PLAN
-------------------------------------------------------------------​------------------------------------------------------------
 Limit  (cost=0.29..14.33 rows=2 width=244) (actual time=0.051..0.071 rows=2 loops=1)
   -&gt;  Index Scan using tenk1_unique2 on tenk1  (cost=0.29..70.50 rows=10 width=244) (actual time=0.051..0.070 rows=2 loops=1)
         Index Cond: (unique2 &gt; 9000)
         Filter: (unique1 &lt; 100)
         Rows Removed by Filter: 287
 Planning Time: 0.077 ms
 Execution Time: 0.086 ms
</pre><p>

    the estimated cost and row count for the Index Scan node are shown as
    though it were run to completion.  But in reality the Limit node stopped
    requesting rows after it got two, so the actual row count is only 2 and
    the run time is less than the cost estimate would suggest.  This is not
    an estimation error, only a discrepancy in the way the estimates and true
    values are displayed.
   </p><p>
    Merge joins also have measurement artifacts that can confuse the unwary.
    A merge join will stop reading one input if it's exhausted the other input
    and the next key value in the one input is greater than the last key value
    of the other input; in such a case there can be no more matches and so no
    need to scan the rest of the first input.  This results in not reading all
    of one child, with results like those mentioned for <code class="literal">LIMIT</code>.
    Also, if the outer (first) child contains rows with duplicate key values,
    the inner (second) child is backed up and rescanned for the portion of its
    rows matching that key value.  <code class="command">EXPLAIN ANALYZE</code> counts these
    repeated emissions of the same inner rows as if they were real additional
    rows.  When there are many outer duplicates, the reported actual row count
    for the inner child plan node can be significantly larger than the number
    of rows that are actually in the inner relation.
   </p><p>
    BitmapAnd and BitmapOr nodes always report their actual row counts as zero,
    due to implementation limitations.
   </p><p>
    Normally, <code class="command">EXPLAIN</code> will display every plan node
    created by the planner.  However, there are cases where the executor
    can determine that certain nodes need not be executed because they
    cannot produce any rows, based on parameter values that were not
    available at planning time.  (Currently this can only happen for child
    nodes of an Append or MergeAppend node that is scanning a partitioned
    table.)  When this happens, those plan nodes are omitted from
    the <code class="command">EXPLAIN</code> output and a <code class="literal">Subplans
    Removed: <em class="replaceable"><code>N</code></em></code> annotation appears
    instead.
   </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="performance-tips.html" title="Chapter 14. Performance Tips">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="performance-tips.html" title="Chapter 14. Performance Tips">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="planner-stats.html" title="14.2. Statistics Used by the Planner">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 14. Performance Tips </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18devel Documentation">Home</a></td><td width="40%" align="right" valign="top"> 14.2. Statistics Used by the Planner</td></tr></table></div></body></html>

  [text/css] stylesheet.css (3.3K, ../../CAApHDvrZD4kyp7jyc=-G4HqbCgXzPpa5eNk-5T8yZbduOqaEnw@mail.gmail.com/3-stylesheet.css)
  download | inline:
/* doc/src/sgml/stylesheet.css */

/* color scheme similar to www.postgresql.org */

body {
	color: #000000;
	background: #FFFFFF;
	font-family: verdana, sans-serif;
}

a:link		{ color:#0066A2; }
a:visited	{ color:#004E66; }
a:active	{ color:#0066A2; }
a:hover		{ color:#000000; }

h1 {
	font-size: 1.4em;
	font-weight: bold;
	margin-top: 0em;
	margin-bottom: 0em;
	color: #EC5800;
}

h2 {
	font-size: 1.2em;
	margin: 1.2em 0em 1.2em 0em;
	font-weight: bold;
	color: #666;
}

.titlepage h2.title,
.refnamediv h2 {
	color: #EC5800;
}

h3 {
	font-size: 1.1em;
	margin: 1.2em 0em 1.2em 0em;
	font-weight: bold;
	color: #666;
}

h4 {
	font-size: 0.95em;
	margin: 1.2em 0em 1.2em 0em;
	font-weight: normal;
	color: #666;
}

h5 {
	font-size: 0.9em;
	margin: 1.2em 0em 1.2em 0em;
	font-weight: normal;
}

h6 {
	font-size: 0.85em;
	margin: 1.2em 0em 1.2em 0em;
	font-weight: normal;
}

/* center some titles */

.book .title, .book .corpauthor, .book .copyright {
	text-align: center;
}

/* decoration for formal examples */

div.example {
	padding-left: 15px;
	border-style: solid;
	border-width: 0px;
	border-left-width: 2px;
	border-color: black;
	margin: 0.5ex;
}

/* Additional formatting for "simplelist" structures */
table.simplelist td {
	padding-left: 2em;
	padding-right: 2em;
}

/* formatting for entries in tables of functions: indent all but first line */

th.func_table_entry p,
td.func_table_entry p {
	margin-top: 0.1em;
	margin-bottom: 0.1em;
	padding-left: 4em;
	text-align: left;
}

p.func_signature {
	text-indent: -3.5em;
}

td.func_table_entry pre.programlisting {
	margin-top: 0.1em;
	margin-bottom: 0.1em;
	padding-left: 4em;
}

/* formatting for entries in tables of catalog/view columns */

th.catalog_table_entry p,
td.catalog_table_entry p {
	margin-top: 0.1em;
	margin-bottom: 0.1em;
	padding-left: 4em;
	text-align: left;
}

th.catalog_table_entry p.column_definition {
	text-indent: -3.5em;
	word-spacing: 0.25em;
}

td.catalog_table_entry p.column_definition {
	text-indent: -3.5em;
}

p.column_definition code.type {
	padding-left: 0.25em;
	padding-right: 0.25em;
}

td.catalog_table_entry pre.programlisting {
	margin-top: 0.1em;
	margin-bottom: 0.1em;
	padding-left: 4em;
}

/* Put these here instead of inside the HTML (see unsetting of
   admon.style in XSL) so that the web site stylesheet can set its own
   style. */

.tip,
.note,
.important,
.caution,
.warning {
	margin-left: 0.5in;
	margin-right: 0.5in;
}

/* miscellaneous */

pre.literallayout, .screen, .synopsis, .programlisting {
	margin-left: 4ex;
}

ul.itemizedlist {
	margin-left: 2.5rem;
}

.comment	{ color: red; }

var		{ font-family: monospace; font-style: italic; }
/* Konqueror's standard style for ACRONYM is italic. */
acronym		{ font-style: inherit; }

.option		{ white-space: nowrap; }

/* make images not too wide on larger screens */
@media (min-width: 800px) {
  .mediaobject {
    width: 75%;
  }
}

/* links to ids of headers and definition terms */

a.id_link {
	color: inherit;
	visibility: hidden;
	text-decoration: none;
}

a.id_link:hover:after {
	content: "Pemalink to this heading";
	font-size: 10px;
	font-weight: normal;
	text-decoration: none;
	border: 1px solid #444444;
	text-align: center;
	border-radius: 5px 5px 5px 5px;
	padding: 5px 5px 5px 5px;
	position: relative;
	top: 20px;
}

*:hover > a.id_link {
	visibility: visible;
}

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-29 14:46  Daniel Gustafsson <daniel@yesql.se>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 36+ messages in thread

From: Daniel Gustafsson @ 2024-10-29 14:46 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 29 Oct 2024, at 12:31, David Rowley <dgrowleyml@gmail.com> wrote:
> 
> On Thu, 17 Oct 2024 at 20:20, Daniel Gustafsson <daniel@yesql.se> wrote:
>> My main concern is that the relative positioning will push it off screen with a
>> break on smaller viewports (like phones).
> 
> I can recreate what you sent in the screenshot, but I have to make my
> browser window as small as it will go and adjust the browser scaling
> to at least 150%. I don't know how to hover over a link on my phone to
> get tooltips to appear. Is it even possible?

Touching the screen without tapping brings up a hover event on iOS, and Android
and Firefox mobile support that as well (even better IIRC).  When trying that
on my iPhone I get the "#" after the link.

> I tried hovering over it
> with my left finger, but it didn't work ;)

You should start live-streaming your web hacking sessions, this sounds
entertaining =)

> One other difference in [1] vs what we have is that they put the # on
> the left of the heading. There's less chance of having horizontal
> wrapping issues when the mouse cursor is over on the left side.
> However, we don't seem to have much of a margin for doing that.

The # tooltip on that page renders outside of the screen for me with just a
sliver of it visible to the left of the text.

On the whole I wonder if we shouldn't just go with the proposal since it
improves the status quo, optimizing for users who hover to get link anchors on
mobile probably isn't worth the investment in time.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-29 22:36  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-10-29 22:36 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, 30 Oct 2024 at 03:46, Daniel Gustafsson <daniel@yesql.se> wrote:
> On the whole I wonder if we shouldn't just go with the proposal since it
> improves the status quo, optimizing for users who hover to get link anchors on
> mobile probably isn't worth the investment in time.

My primary motivation for hacking on this was to try to reduce the
confusion and reports about the mysterious #. I imagine the patch will
improve that situation, but it does risk us getting new reports if
there's something off with these changes.

My thoughts are that it doesn't seem excessively critical that this is
perfect on the first attempt. I'd be happy to see us try to improve
this. Maybe if there's some better way, someone will appear and tell
us how to do it properly. I am hopeful that we're not just swapping
one problem for another.

Do you have access to make this change?  I think it needs to go into
https://www.postgresql.org/media/css/main.css

David





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-10-29 22:39  Daniel Gustafsson <daniel@yesql.se>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 1 reply; 36+ messages in thread

From: Daniel Gustafsson @ 2024-10-29 22:39 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 29 Oct 2024, at 23:36, David Rowley <dgrowleyml@gmail.com> wrote:

> My thoughts are that it doesn't seem excessively critical that this is
> perfect on the first attempt. I'd be happy to see us try to improve
> this. Maybe if there's some better way, someone will appear and tell
> us how to do it properly. I am hopeful that we're not just swapping
> one problem for another.

Agreed, even if not perfect I think this is an improvement.

> Do you have access to make this change?  I think it needs to go into
> https://www.postgresql.org/media/css/main.css

I have a pgweb commitbit so if you roll a patch for it I can take care of the
rest.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 06:10  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-11-06 06:10 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, 30 Oct 2024 at 11:39, Daniel Gustafsson <daniel@yesql.se> wrote:
>
> > On 29 Oct 2024, at 23:36, David Rowley <dgrowleyml@gmail.com> wrote:
> > Do you have access to make this change?  I think it needs to go into
> > https://www.postgresql.org/media/css/main.css
>
> I have a pgweb commitbit so if you roll a patch for it I can take care of the
> rest.

Thanks. Patch attached.

David
From 6b26501e43b4acb6f4c60f03f3194ad0403b88cf Mon Sep 17 00:00:00 2001
From: David Rowley <dgrowley@gmail.com>
Date: Wed, 6 Nov 2024 19:07:27 +1300
Subject: [PATCH] Adjust CSS to have tooltips in the H2 headings in the docs

There's been at least one complaint about a stray # that appears in the
manual.  Add a tooltip to this to make it more clear why this appears
and what it's for.
---
 media/css/main.css | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/media/css/main.css b/media/css/main.css
index cbfea862..71364f19 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -1183,6 +1183,20 @@ code,
 #docContent a.id_link {
   color: inherit;
   visibility: hidden;
+  text-decoration: none;
+}
+
+#docContent a.id_link:hover:after {
+  content: "Permalink to this heading";
+  font-size: 10px;
+  font-weight: normal;
+  text-decoration: none;
+  border: 1px solid #444444;
+  text-align: center;
+  border-radius: 5px 5px 5px 5px;
+  padding: 5px 5px 5px 5px;
+  position: relative;
+  top: 20px;
 }
 
 #docContent *:hover > a.id_link {
-- 
2.40.1.windows.1



Attachments:

  [text/plain] 0001-Adjust-CSS-to-have-tooltips-in-the-H2-headings-in-th.patch (1.1K, ../../CAApHDvrEyOhv8ofRNmkYbMiRUufnR3MdrbDPjEi_B-Y5i2UNbA@mail.gmail.com/2-0001-Adjust-CSS-to-have-tooltips-in-the-H2-headings-in-th.patch)
  download | inline diff:
From 6b26501e43b4acb6f4c60f03f3194ad0403b88cf Mon Sep 17 00:00:00 2001
From: David Rowley <dgrowley@gmail.com>
Date: Wed, 6 Nov 2024 19:07:27 +1300
Subject: [PATCH] Adjust CSS to have tooltips in the H2 headings in the docs

There's been at least one complaint about a stray # that appears in the
manual.  Add a tooltip to this to make it more clear why this appears
and what it's for.
---
 media/css/main.css | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/media/css/main.css b/media/css/main.css
index cbfea862..71364f19 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -1183,6 +1183,20 @@ code,
 #docContent a.id_link {
   color: inherit;
   visibility: hidden;
+  text-decoration: none;
+}
+
+#docContent a.id_link:hover:after {
+  content: "Permalink to this heading";
+  font-size: 10px;
+  font-weight: normal;
+  text-decoration: none;
+  border: 1px solid #444444;
+  text-align: center;
+  border-radius: 5px 5px 5px 5px;
+  padding: 5px 5px 5px 5px;
+  position: relative;
+  top: 20px;
 }
 
 #docContent *:hover > a.id_link {
-- 
2.40.1.windows.1



^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 13:32  Daniel Gustafsson <daniel@yesql.se>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 2 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-11-06 13:32 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 6 Nov 2024, at 07:10, David Rowley <dgrowleyml@gmail.com> wrote:
> 
> On Wed, 30 Oct 2024 at 11:39, Daniel Gustafsson <daniel@yesql.se> wrote:
>> 
>>> On 29 Oct 2024, at 23:36, David Rowley <dgrowleyml@gmail.com> wrote:
>>> Do you have access to make this change?  I think it needs to go into
>>> https://www.postgresql.org/media/css/main.css
>> 
>> I have a pgweb commitbit so if you roll a patch for it I can take care of the
>> rest.
> 
> Thanks. Patch attached.

Committed, and with some help from Magnus, the docs site has been reloaded with
the new CSS.  Everything seems to behave as expected when testing in Firefox,
Safari, Chrome and Edge.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 14:51  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 2 replies; 36+ messages in thread

From: Alvaro Herrera @ 2024-11-06 14:51 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Rowley <dgrowleyml@gmail.com>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On 2024-Nov-06, Daniel Gustafsson wrote:

> Committed, and with some help from Magnus, the docs site has been reloaded with
> the new CSS.  Everything seems to behave as expected when testing in Firefox,
> Safari, Chrome and Edge.

Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
was there any voice against that?

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 14:58  Daniel Gustafsson <daniel@yesql.se>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  1 sibling, 2 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-11-06 14:58 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: David Rowley <dgrowleyml@gmail.com>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 6 Nov 2024, at 15:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> 
> On 2024-Nov-06, Daniel Gustafsson wrote:
> 
>> Committed, and with some help from Magnus, the docs site has been reloaded with
>> the new CSS.  Everything seems to behave as expected when testing in Firefox,
>> Safari, Chrome and Edge.
> 
> Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
> was there any voice against that?

You're right, I mistakenly remembered there being no concensus and didn't
re-read the thread when it was revived with the patch in question.  Re-reading
it now I see multiple +1's for using a ¶ instead so will fix that.  Thanks for
the heads-up.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 19:31  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 0 replies; 36+ messages in thread

From: David Rowley @ 2024-11-06 19:31 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 7 Nov 2024 at 02:33, Daniel Gustafsson <daniel@yesql.se> wrote:
> Committed, and with some help from Magnus, the docs site has been reloaded with
> the new CSS.  Everything seems to behave as expected when testing in Firefox,
> Safari, Chrome and Edge.

Great. Thank you to you both.

David





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 19:34  David Rowley <dgrowleyml@gmail.com>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 36+ messages in thread

From: David Rowley @ 2024-11-06 19:34 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 7 Nov 2024 at 03:58, Daniel Gustafsson <daniel@yesql.se> wrote:
>
> > On 6 Nov 2024, at 15:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
> > was there any voice against that?
>
> You're right, I mistakenly remembered there being no concensus and didn't
> re-read the thread when it was revived with the patch in question.  Re-reading
> it now I see multiple +1's for using a ¶ instead so will fix that.  Thanks for
> the heads-up.

I see in the release notes we're using §. I'm not advocating for any
particular one, but would it make sense to be consistent on which
character we use for this?

David





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-06 19:39  Daniel Gustafsson <daniel@yesql.se>
  parent: David Rowley <dgrowleyml@gmail.com>
  0 siblings, 0 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-11-06 19:39 UTC (permalink / raw)
  To: David Rowley <dgrowleyml@gmail.com>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 6 Nov 2024, at 20:34, David Rowley <dgrowleyml@gmail.com> wrote:
> 
> On Thu, 7 Nov 2024 at 03:58, Daniel Gustafsson <daniel@yesql.se> wrote:
>> 
>>> On 6 Nov 2024, at 15:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>>> Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
>>> was there any voice against that?
>> 
>> You're right, I mistakenly remembered there being no concensus and didn't
>> re-read the thread when it was revived with the patch in question.  Re-reading
>> it now I see multiple +1's for using a ¶ instead so will fix that.  Thanks for
>> the heads-up.
> 
> I see in the release notes we're using §. I'm not advocating for any
> particular one, but would it make sense to be consistent on which
> character we use for this?

The § in the release notes is for links leading from the page in question,
whereas the # on the title element is a permalink to the page in question, so I
think it's better to use different symbols given that they perform different
tasks.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-12 11:51  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  1 sibling, 1 reply; 36+ messages in thread

From: Alvaro Herrera @ 2024-11-12 11:51 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Rowley <dgrowleyml@gmail.com>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

By the way, is there something funny going on with the transparency of
these tooltips?  I was looking at this page today
https://www.postgresql.org/docs/current/creating-cluster.html
and see it like the attached screenshot.  The tooltip appears to have no
background color, so the text underneath shows through, which is weird ...

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
#error "Operator lives in the wrong universe"
  ("Use of cookies in real-time system development", M. Gleixner, M. Mc Guire)

Attachments:

  [image/png] transparent.png (30.1K, ../../202411121151.26wgu4vwcglm@alvherre.pgsql/2-transparent.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-12 12:11  Daniel Gustafsson <daniel@yesql.se>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-11-12 12:11 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: David Rowley <dgrowleyml@gmail.com>; Bruce Momjian <bruce@momjian.us>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 12 Nov 2024, at 12:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> 
> By the way, is there something funny going on with the transparency of
> these tooltips?  I was looking at this page today
> https://www.postgresql.org/docs/current/creating-cluster.html
> and see it like the attached screenshot.  The tooltip appears to have no
> background color, so the text underneath shows through, which is weird ...

Seems like av oversight omitting the background-color in the original patch,
and in testing I wasn't using a viewport where the tooltip overlapped content.
The attached (lightly tested) diff should fix that according to the currently
chosen colorscheme.

--
Daniel Gustafsson

Attachments:

  [application/octet-stream] id_link_bgcolor.diff (1.0K, ../../E45956B9-A518-4BC8-991A-3A03CC43B988@yesql.se/2-id_link_bgcolor.diff)
  download | inline diff:
diff --git a/media/css/main.css b/media/css/main.css
index 71364f19..80c127b9 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -80,6 +80,7 @@
   --doccontent-code-bg-color: inherit;
   --doccontent-code-fg-color: inherit;
   --doccontent-code-warning-note-bg-color: transparent;
+  --doccontent-id-link-bg-color: #fff;
   --doccontent-pre-code-bg-color: #f8f9fa;
   --doccontent-pre-code-callout-bg-color: transparent;
   --doccontent-pre-code-fg-color: inherit;
@@ -197,6 +198,7 @@
     --doccontent-blockquote-table-tip-bg-color: none;
     --doccontent-blockquote-table-warning-bg-color: #1e0c0c;
     --doccontent-callout-fg-color: #f3f5f9;
+    --doccontent-id-link-bg-color: #000;
     --doccontent-pre-code-bg-color: #4a4a4a;
     --doccontent-table-bdr-color: #6b6b6b;
     --doccontent-table-bg-color: #4a4a4a;
@@ -1194,6 +1196,7 @@ code,
   border: 1px solid #444444;
   text-align: center;
   border-radius: 5px 5px 5px 5px;
+  background-color:var (--doccontent-id-link-bg-color);
   padding: 5px 5px 5px 5px;
   position: relative;
   top: 20px;

^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-18 19:51  Bruce Momjian <bruce@momjian.us>
  parent: Daniel Gustafsson <daniel@yesql.se>
  1 sibling, 1 reply; 36+ messages in thread

From: Bruce Momjian @ 2024-11-18 19:51 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; David Rowley <dgrowleyml@gmail.com>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, Nov  6, 2024 at 03:58:18PM +0100, Daniel Gustafsson wrote:
> > On 6 Nov 2024, at 15:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > 
> > On 2024-Nov-06, Daniel Gustafsson wrote:
> > 
> >> Committed, and with some help from Magnus, the docs site has been reloaded with
> >> the new CSS.  Everything seems to behave as expected when testing in Firefox,
> >> Safari, Chrome and Edge.
> > 
> > Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
> > was there any voice against that?
> 
> You're right, I mistakenly remembered there being no concensus and didn't
> re-read the thread when it was revived with the patch in question.  Re-reading
> it now I see multiple +1's for using a ¶ instead so will fix that.  Thanks for
> the heads-up.

Uh, has this change been made?  I still see "#":

	https://www.postgresql.org/docs/devel/tutorial-arch.html

I am actually fine with "#" since that is the symbol that will be added
to the URL.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  When a patient asks the doctor, "Am I going to die?", he means 
  "Am I going to die soon?"





^ permalink  raw  reply  [nested|flat] 36+ messages in thread

* Re: A minor bug in doc. Hovering over heading shows # besides it.
@ 2024-11-20 14:59  Daniel Gustafsson <daniel@yesql.se>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 0 replies; 36+ messages in thread

From: Daniel Gustafsson @ 2024-11-20 14:59 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>; David Rowley <dgrowleyml@gmail.com>; Jonathan S. Katz <jkatz@postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Muhammad Ikram <mmikram@gmail.com>; pgsql-docs@lists.postgresql.org

> On 18 Nov 2024, at 20:51, Bruce Momjian <bruce@momjian.us> wrote:
> 
> On Wed, Nov  6, 2024 at 03:58:18PM +0100, Daniel Gustafsson wrote:
>>> On 6 Nov 2024, at 15:51, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>>> 
>>> On 2024-Nov-06, Daniel Gustafsson wrote:
>>> 
>>>> Committed, and with some help from Magnus, the docs site has been reloaded with
>>>> the new CSS.  Everything seems to behave as expected when testing in Firefox,
>>>> Safari, Chrome and Edge.
>>> 
>>> Ah, but we kept the #?  I thought it was going to be changed to ¶ ...
>>> was there any voice against that?
>> 
>> You're right, I mistakenly remembered there being no concensus and didn't
>> re-read the thread when it was revived with the patch in question.  Re-reading
>> it now I see multiple +1's for using a ¶ instead so will fix that.  Thanks for
>> the heads-up.
> 
> Uh, has this change been made?  I still see "#":

It hasn't been changed, I was hoping to hear more opinions but since there has
been none I will go ahead with the result of the previous discussion which
landed in ¶.

Hearing no complaints against the fix for the issue Álvaro identified I'll push
that as well.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 36+ messages in thread


end of thread, other threads:[~2024-11-20 14:59 UTC | newest]

Thread overview: 36+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-18 04:55 A minor bug in doc. Hovering over heading shows # besides it. Muhammad Ikram <mmikram@gmail.com>
2024-07-18 05:02 ` Kashif Zeeshan <kashi.zeeshan@gmail.com>
2024-07-18 05:07   ` David G. Johnston <david.g.johnston@gmail.com>
2024-07-18 05:06 ` David G. Johnston <david.g.johnston@gmail.com>
2024-07-18 05:07 ` David Rowley <dgrowleyml@gmail.com>
2024-07-18 05:17   ` Kashif Zeeshan <kashi.zeeshan@gmail.com>
2024-07-18 05:18   ` Tom Lane <tgl@sss.pgh.pa.us>
2024-07-18 05:45     ` David G. Johnston <david.g.johnston@gmail.com>
2024-07-18 06:40     ` David Rowley <dgrowleyml@gmail.com>
2024-07-18 07:19       ` Dean Rasheed <dean.a.rasheed@gmail.com>
2024-07-18 07:46     ` Daniel Gustafsson <daniel@yesql.se>
2024-07-18 09:16       ` David Rowley <dgrowleyml@gmail.com>
2024-07-18 13:49       ` Tom Lane <tgl@sss.pgh.pa.us>
2024-07-18 17:59         ` Daniel Gustafsson <daniel@yesql.se>
2024-07-18 18:03           ` Tom Lane <tgl@sss.pgh.pa.us>
2024-07-18 18:03           ` Jonathan S. Katz <jkatz@postgresql.org>
2024-08-12 02:19             ` David Rowley <dgrowleyml@gmail.com>
2024-10-16 22:18               ` Bruce Momjian <bruce@momjian.us>
2024-10-16 22:37                 ` David G. Johnston <david.g.johnston@gmail.com>
2024-10-16 23:24                 ` David Rowley <dgrowleyml@gmail.com>
2024-10-17 07:20                   ` Daniel Gustafsson <daniel@yesql.se>
2024-10-29 11:31                     ` David Rowley <dgrowleyml@gmail.com>
2024-10-29 14:46                       ` Daniel Gustafsson <daniel@yesql.se>
2024-10-29 22:36                         ` David Rowley <dgrowleyml@gmail.com>
2024-10-29 22:39                           ` Daniel Gustafsson <daniel@yesql.se>
2024-11-06 06:10                             ` David Rowley <dgrowleyml@gmail.com>
2024-11-06 13:32                               ` Daniel Gustafsson <daniel@yesql.se>
2024-11-06 14:51                                 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2024-11-06 14:58                                   ` Daniel Gustafsson <daniel@yesql.se>
2024-11-06 19:34                                     ` David Rowley <dgrowleyml@gmail.com>
2024-11-06 19:39                                       ` Daniel Gustafsson <daniel@yesql.se>
2024-11-18 19:51                                     ` Bruce Momjian <bruce@momjian.us>
2024-11-20 14:59                                       ` Daniel Gustafsson <daniel@yesql.se>
2024-11-12 11:51                                   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2024-11-12 12:11                                     ` Daniel Gustafsson <daniel@yesql.se>
2024-11-06 19:31                                 ` David Rowley <dgrowleyml@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox