Re: PostgreSQL 9.6 Temporary files

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Jimmy Augustine <jimmy(dot)augustine(at)enyx(dot)fr>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL 9.6 Temporary files
Date: 2018-03-19 17:20:48
Message-ID: CANu8FizvopAk5OqMOZcOsc_DxnsKM=nDyuwJjN+QQEDfaUVxzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 19, 2018 at 1:17 PM, Jimmy Augustine <jimmy(dot)augustine(at)enyx(dot)fr>
wrote:

> Hi,
>
> I used this command and I found the same value in total_size column.
>
> 2018-03-19 18:01 GMT+01:00 Melvin Davidson <melvin6925(at)gmail(dot)com>:
>
>>
>>
>> On Mon, Mar 19, 2018 at 12:45 PM, Adrian Klaver <
>> adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>
>>> On 03/19/2018 09:31 AM, Jimmy Augustine wrote:
>>>
>>>> Dear Friends,
>>>>
>>>> I am newbie to postgresql.
>>>> I have 162 GB on my database but when I check size of all tables, I
>>>> approximately obtain 80 GB.
>>>> I also see that I have 68GB of temporary files however I only found
>>>> 2.4MB at postgres/data/base/pgsql_tmp.
>>>>
>>>
>>> Exactly how did you determine this?
>>>
>>>
>>>> Could you tell me what are those temporary files and where are they at?
>>>> Can I delete some of them?
>>>>
>>>> All values come from pgAdmin 4 and checked by my own SQL
>>>> queries(postgresql-9.6).
>>>>
>>>
>>> Can you show actual queries used?
>>>
>>> I already run vacuum full and there is few dead tuples.
>>>>
>>>> Best regards,
>>>> Jimmy AUGUSTINE
>>>>
>>>
>>>
>>> --
>>> Adrian Klaver
>>> adrian(dot)klaver(at)aklaver(dot)com
>>>
>>> > I have 162 GB on my database but when I check size of all tables, I
>> approximately obtain 80 GB.
>> >I also see that I have 68GB of temporary files however I only found
>> 2.4MB at postgres/data/base/pgsql_tmp.
>>
>>
>> *I am not sure what your query was that deteremined table and index
>> sizes, but try using the query instead.*
>>
>> *Note that total_size is the size of the table and all it's indexes.*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *SELECT n.nspname as schema, c.relname as table, a.rolname as
>> owner, c.relfilenode as filename, c.reltuples::bigint,
>> pg_size_pretty(pg_relation_size(quote_ident(n.nspname) || '.' ||
>> quote_ident(c.relname) )) as size,
>> pg_size_pretty(pg_total_relation_size(quote_ident(n.nspname) || '.' ||
>> quote_ident(c.relname) )) as total_size,
>> pg_relation_size(quote_ident(n.nspname) || '.' || quote_ident(c.relname) )
>> as size_bytes, pg_total_relation_size(quote_ident(n.nspname) || '.'
>> || quote_ident(c.relname) ) as total_size_bytes, CASE WHEN
>> c.reltablespace = 0 THEN 'pg_default' ELSE (SELECT
>> t.spcname FROM pg_tablespace t WHERE (t.oid =
>> c.reltablespace) ) END as tablespaceFROM
>> pg_class c JOIN pg_namespace n ON (n.oid = c.relnamespace) JOIN pg_authid
>> a ON ( a.oid = c.relowner ) WHERE quote_ident(nspname) NOT LIKE 'pg_%'
>> AND quote_ident(relname) NOT LIKE 'pg_%' AND quote_ident(relname) NOT
>> LIKE 'information%' AND quote_ident(relname) NOT LIKE 'sql_%' AND
>> quote_ident(relkind) IN ('r')ORDER BY total_size_bytes DESC, 1, 2;-- *
>>
>>
>>
>> *Melvin DavidsonMaj. Database & Exploration SpecialistUniverse
>> Exploration Command – UXCEmployment by invitation only!*
>>
>
>

*>I used this command and I found the same value in total_size column. *

*Please be specific. Exactly WHAT is the SQL query? *

--
*Melvin Davidson*
*Maj. Database & Exploration Specialist*
*Universe Exploration Command – UXC*
Employment by invitation only!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jimmy Augustine 2018-03-19 17:21:42 Re: PostgreSQL 9.6 Temporary files
Previous Message Jimmy Augustine 2018-03-19 17:17:46 Re: PostgreSQL 9.6 Temporary files