Re: Getting a better performance

From: Emily de Souza <emilysouzabg(at)gmail(dot)com>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Getting a better performance
Date: 2015-12-09 20:40:51
Message-ID: CAE7yxx7jXnxo_58ti0jZ+aCtXMDC3Uok-KxnCVfBBCKEOmsrnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi there!

INSERT INTO gorfs.nodes(node_full_path, object_type, permissions)
SELECT
pn.node_full_path, pn.object_type, pn.permissions
FROM
(
VALUES
(CAST(0 AS SMALLINT), CAST('/userfiles' AS gorfs.absolute_pathname),
CAST('S_IFDIR' AS gorfs.mode_t_constant_name), CAST('111111111' AS BIT(9))),
(1, '/userfiles/account', 'S_IFDIR', '111111111'),
(2, '/userfiles/account/2681', 'S_IFDIR', '111111111'),
(3, '/userfiles/account/2681/attachment', 'S_IFDIR', '111111111'),
(4, '/userfiles/account/2681/attachment/33168371', 'S_IFDIR', '111111111'),
(5, '/userfiles/account/2681/attachment/33168371/file', 'S_IFDIR',
'111111111'),
(6, '/userfiles/account/2681/attachment/33168371/file/7038561', 'S_IFDIR',
'111111111'),
(7,
'/userfiles/account/2681/attachment/33168371/file/7038561/main.with_name',
'S_IFDIR', '111111111')
) AS pn(elevation, node_full_path, object_type, permissions)
WHERE
(NOT EXISTS(SELECT 0 FROM gorfs.nodes AS en WHERE (pn.elevation < 7) AND
(en.node_full_path = pn.node_full_path) AND (en.object_type = 'S_IFDIR')))
ORDER BY
pn.elevation ASC
;

It took 8.120 ms...
Running an "api.php" from the website.

Thanks :)

2015-12-10 2:56 GMT+13:00 Kevin Grittner <kgrittn(at)gmail(dot)com>:

> On Tue, Dec 8, 2015 at 10:29 PM, Emily de Souza <emilysouzabg(at)gmail(dot)com>
> wrote:
>
> > I've got 3 DB servers, running PostgreSQL 9.2.14 with PHP APIs:
> >
> > 1 - Master DB (16 cores, 128 GB RAM, RAID 10)
> > 2 - Slave (warm standby DB - full sized)
> > 3 - Slave (warm standby DB - full sized)
> > 4 - Slave (warm standby DB)
> >
> > I would like to improve the performance, by slowing the response
> > time (ms) of the DB server.
> > But I don't know where to start.
> > Do you have some tips/how to about how can I get the information
> > that I need?
>
> Without more detail about your problem and what you're trying to
> achieve, it is hard to make a suggestion. If you can pick out a
> query that is taking longer than you expect, you might want to
> present that to the performance list, following the advice here:
>
> https://wiki.postgresql.org/wiki/SlowQueryQuestions
>
> --
> Kevin Grittner
> EDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Shih Théo 2015-12-11 10:02:27 How to fix the problem of "archiver process failed"
Previous Message Yogi Barot 2015-12-09 15:37:05 Pg_upgrade error urgent help