how to know that one query use the data in the os cache

2018-09-26 Thread jimmy
I use postgresql for windows server 2012 R2. I use select pg_prewarm('tablename','read','main'); to load data into the os cache. How can I know the database used the data in the os cache when I use the sql, select * from tablename, to query. explain(analyze true, buffers true) select * from

Re:Re: how to clean the cache from databases and operating system

2018-09-26 Thread jimmy
I use windows server 2012 R2. How to drop postgresql's data in the system cache. In windows server 2012 R2, I restart postgresql by restarting postgresql service, wether it can drop postgres' cache? At 2018-09-26 22:52:08, "Maxence Ahlouche" wrote: Hi, On 26 September 2018 at 08:25,

Re: Out of Memory

2018-09-26 Thread Laurenz Albe
greigwise wrote: > All right.. one more thing here. Any suggestions for how to set overcommit > on a postgres db server with 16 GB of RAM and no swap? I think I want > vm.overcommit_memory = 2, as I understand that prevents the OOM killer from > zapping me. Is 100% the right way to go for

Re: Setting up continuous archiving

2018-09-26 Thread Pierre Timmermans
Hello What you are doing is called "log shipping", which means that when a wal (write-ahead log) is filled in on the database server you ship it to a backup server via rsync. It is fine but as you said the disadvantage is that the file is shipped only when it is full, so you could have data

Re: Why the sql is not executed in parallel mode

2018-09-26 Thread pinker
Which version are you running? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Re: Out of Memory

2018-09-26 Thread greigwise
All right.. one more thing here. Any suggestions for how to set overcommit on a postgres db server with 16 GB of RAM and no swap? I think I want vm.overcommit_memory = 2, as I understand that prevents the OOM killer from zapping me. Is 100% the right way to go for overcommit_ratio? Is there

Re: Out of Memory

2018-09-26 Thread greigwise
I think I figured it out: vm.overcommit_memory = 2 vm.overcommit_ratio = 50 Only allows me to use 50% of my RAM... ugh! I have 16 GB, so when only 8 is left, I start seeing OOM. Will increase this setting and see if it helps. Thanks everyone for the help. Greig -- Sent from:

Re: how to clean the cache from databases and operating system

2018-09-26 Thread Maxence Ahlouche
Hi, On 26 September 2018 at 08:25, jimmy wrote: > 1、When I execute the firse sql query, like below: > select * from tablename; > there are some datas that will be loaded into the database cache. > How to clean the data from cache. > 2、When I execute second sql query like below: >

Re: Out of Memory

2018-09-26 Thread greigwise
Tom Lane-2 wrote > greigwise > greigwise@ > writes: >> Is it possible that the fact that my stack size is limited is what is >> causing my issue? > > No. If you were hitting that limit you'd get a message specifically > talking about stack. > > regards, tom lane Well,

Re: Setting up continuous archiving

2018-09-26 Thread Stephen Frost
Greetings, * Yuri Kanivetsky (yuri.kanivet...@gmail.com) wrote: > I'm trying to compile a basic set of instruction needed to set up > continuous archiving and to recover from a backup. I'm running > PostgreSQL 9.3 on Debian Stretch system. 9.3 is about to be end-of-life in just another month or

Re: Out of Memory

2018-09-26 Thread Tom Lane
greigwise writes: > Is it possible that the fact that my stack size is limited is what is > causing my issue? No. If you were hitting that limit you'd get a message specifically talking about stack. regards, tom lane

Re: Out of Memory

2018-09-26 Thread greigwise
There is also this: -bash-4.2$ prlimit -p 6590 RESOURCE DESCRIPTION SOFT HARD UNITS AS address space limitunlimited unlimited bytes CORE max core file size 0 unlimited blocks CPUCPU time

Re: using the nextval('sequence_name') in sql, the result maybe is not right

2018-09-26 Thread Adrian Klaver
On 9/26/18 5:05 AM, Wanglin wrote: Hi, all:     PostgreSQL version : 10.3.  I use "nextval" in the sql , but I think the result is not right, maybe it is a bug. *The test case as bellow:* create sequence seq1; select nextval('seq1'); create table tx1(id1 int, id2 int); insert into tx1 select

Re: using the nextval('sequence_name') in sql, the result maybe is not right

2018-09-26 Thread Alban Hertroys
On Wed, 26 Sep 2018 at 14:08, Wanglin wrote: > > Hi, all: > PostgreSQL version : 10.3. I use "nextval" in the sql , but I think the > result is not right, maybe it is a bug. >The test case as bellow: >create sequence seq1; > select nextval('seq1'); > create table tx1(id1 int, id2

using the nextval('sequence_name') in sql, the result maybe is not right

2018-09-26 Thread Wanglin
Hi, all: PostgreSQL version : 10.3. I use "nextval" in the sql , but I think the result is not right, maybe it is a bug. The test case as bellow: create sequence seq1; select nextval('seq1'); create table tx1(id1 int, id2 int); insert into tx1 select generate_series(1,100),

Re: Setting up continuous archiving

2018-09-26 Thread David Steele
On 9/26/18 8:20 AM, Yuri Kanivetsky wrote: I'm trying to compile a basic set of instruction needed to set up continuous archiving and to recover from a backup. I'm running PostgreSQL 9.3 on Debian Stretch system. This is an incredibly complex topic and it is very difficult to implement

Setting up continuous archiving

2018-09-26 Thread Yuri Kanivetsky
Hi, I'm trying to compile a basic set of instruction needed to set up continuous archiving and to recover from a backup. I'm running PostgreSQL 9.3 on Debian Stretch system. I've got a database and a backup servers. The idea is to set up WAL archiving, and occasionally do full (base) backups. A

how to clean the cache from databases and operating system

2018-09-26 Thread jimmy
1、When I execute the firse sql query, like below: select * from tablename; there are some datas that will be loaded into the database cache. How to clean the data from cache. 2、When I execute second sql query like below: SELECT pg_prewarm('tablename', 'buffer') . Data will be