Re: what's the slowest part in the SQL - Mailing list pgsql-performance

From Suya Huang
Subject Re: what's the slowest part in the SQL
Date
Msg-id 3793BB13-D4D7-41CF-8C8B-FEB6EE20234B@connexity.com
Whole thread Raw
In response to Re: what's the slowest part in the SQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Not really, the server has 2 GB memory (PROD is a lot more than this dev box), so the table should be able to fit in
memoryif we preload them.
 

MemTotal:        2049572 kB

dev=# select pg_size_pretty(pg_relation_size('data'));
 pg_size_pretty
----------------
 141 MB
(1 row)

Time: 2.640 ms

dev=# select pg_size_pretty(pg_relation_size('order'));
 pg_size_pretty
----------------
 516 MB
(1 row)

Thanks,
Suya
On 8/10/16, 11:57 AM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

Suya Huang <shuang@connexity.com> writes:
> Thank you Tom very much, that’s the piece of information I miss. 
> So, should I expect that the nested loop join would be much faster if I cache both tables (use pg_prewarm) into
memoryas it waives the disk read?
 

pg_prewarm is not going to magically fix things if your table is bigger
than RAM, which it apparently is.

            regards, tom lane



pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: what's the slowest part in the SQL
Next
From: Ivan Voras
Date:
Subject: Logging queries using sequential scans