pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Celia McInnis <celia.mcinnis@gmail.com>
Cc: Erik Wienhold <ewie@ewie.name>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Dropping a temporary view?
Date: Wed, 20 Mar 2024 10:01:37 -0700
Message-ID: <2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com> (raw)
In-Reply-To: <CAGD6t7+vGjFj=VYWDsnwFg=7j13xEnceJ11aRBvHQis5QdHrpQ@mail.gmail.com>
References: <CAGD6t7JniiFU5_tu=1Dpa1-E_HjVdWyT8T7RaU6uTZ-7WF9TiQ@mail.gmail.com>
	<p3bniwsob54rr2y436hhjkl6c44k3refzzyjeqmh365fig726a@qq6ht7hzh4j6>
	<CAGD6t7+xR3YpP3QurENxL1p1FAv8zohd_8cg=tNRX10NZGHQZA@mail.gmail.com>
	<5b2ebf67-df3b-4b94-8a27-74d20d28f014@aklaver.com>
	<CAGD6t7+vGjFj=VYWDsnwFg=7j13xEnceJ11aRBvHQis5QdHrpQ@mail.gmail.com>

On 3/20/24 09:51, Celia McInnis wrote:
> The view is being used in some web query software that multiple people 
> will be accessing and the contents of the view depend on what the person 
> is querying, so I think that temporary views or tables are a good idea. 
> I change to non-temporary views or tables (in a test version of the 
> software which is not web-crawl-able) when I'm trying to debug things, 
> and I guess I have to be careful to clean those up when I switch back to 
> the temporary tables/views.

Why change behavior for the tests? Seems that sort of negates the value 
of the testing.

Have you run EXPLAIN ANALYZE on the problem query?


> 
> 
> 
> On Wed, Mar 20, 2024 at 11:46 AM Adrian Klaver 
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     On 3/20/24 08:39, Celia McInnis wrote:
>      > Ok, thanks - so I guess that means that if there is both a
>     temporary and
>      > a non temporary view called "tempvie",
>      >
>      > DROP VIEW tempview;
>      >
>      > will remove the 1st tempview found, which with my path is the
>     temporary
>      > one. Is there some reason why it then took 7 minutes to select
>     from the
>      > non-temporary view tempview after I dropped the temporary view
>     tempview?
>      >
>      > I have sometimes had some very long query times when running query
>      > software, and maybe they are resulting from my switching between
>      > temporary and non-temporary views of the same name while
>     debugging. If
>      > so, is there something I should be doing to clean up any temporary
>      > messes I am creating?
> 
>     What is the purpose of the temp view over the the regular view process?
> 
>     How do they differ in data?
> 
>     Is all the above happening in one session?
> 
>     Have you run EXPLAIN ANALYZE on the select from the regular view?
> 
>      >
>      > Thanks,
>      > Celia McInnis
>      >
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (16+ messages)  latest in thread

Message-ID: <2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com>
Permalink:  ../2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com/
Also on:    postgresql.org/message-id/2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, celia.mcinnis@gmail.com, ewie@ewie.name
  Subject: Re: Dropping a temporary view?
  In-Reply-To: <2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com>
  References: <CAGD6t7JniiFU5_tu=1Dpa1-E_HjVdWyT8T7RaU6uTZ-7WF9TiQ@mail.gmail.com> <p3bniwsob54rr2y436hhjkl6c44k3refzzyjeqmh365fig726a@qq6ht7hzh4j6> <CAGD6t7+xR3YpP3QurENxL1p1FAv8zohd_8cg=tNRX10NZGHQZA@mail.gmail.com> <5b2ebf67-df3b-4b94-8a27-74d20d28f014@aklaver.com> <CAGD6t7+vGjFj=VYWDsnwFg=7j13xEnceJ11aRBvHQis5QdHrpQ@mail.gmail.com> <2ce8c3d5-2a54-4c8d-b0bd-bb4f4967b515@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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