Re: EXPLAIN <query> command just hangs...

From: Rhhh Lin <ruanlinehan(at)hotmail(dot)com>
To: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: EXPLAIN <query> command just hangs...
Date: 2017-11-04 02:29:05
Message-ID: DB6PR1001MB1141E8C4AED2BCDE9987CE31AE520@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

That helps, thanks Peter.

Regards,

Ruan

________________________________
From: pgsql-general-owner(at)postgresql(dot)org <pgsql-general-owner(at)postgresql(dot)org> on behalf of Peter J. Holzer <hjp-pgsql(at)hjp(dot)at>
Sent: 03 November 2017 08:49
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] EXPLAIN <query> command just hangs...

On 2017-11-02 20:51:23 +0000, Rhhh Lin wrote:
[...]
> where timestamp BETWEEN 1506676560000 AND 1508750220000
[...]
> *Also, as a sidenote - can someone please expand on why one (I was not involved
> in the creation of this DB/schema definition) would choose to have the
> definition of the timestamp column as a bigint in this case?

The numbers look like Java timestamps (Milliseconds since the epoch). So
probably the programs accessing the database are written in Java and the
programmer decided that it's simpler to do all timestamp computations in
Java than in SQL. Or maybe the programmer just felt more comfortable
with Java-like timestamps than with calendar dates. (I have done the
same (with Unix timestamps, i.e. seconds since the epoch). Although in
the cases where I've done it I had the additional excuse that the
database didn't support timestamps with timezones, which isn't the case
for PostgreSQL.)

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp(at)hjp(dot)at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
Peter Holzer's Home Page - Peter Johannes Holzer ...<http://www.hjp.at/>
www.hjp.at
Peter Johannes Holzer ..... was the name my parents chose to have written in my certificate of baptism. Not being content with two Christian names, my fellow men ...

[https://www.edge.org/sites/default/files/edge_logo.jpg]<https://www.edge.org/>

Edge.org<https://www.edge.org/>
www.edge.org
To arrive at the edge of the world's knowledge, seek out the most complex and sophisticated minds, put them in a room together, and have them ask each other the ...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-11-04 16:35:25 Re: EXPLAIN <query> command just hangs...
Previous Message Rhhh Lin 2017-11-04 02:28:03 Re: