| From: | Alexander Farber <alexander(dot)farber(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Comparing epoch to timestamp |
| Date: | 2017-10-30 11:33:17 |
| Message-ID: | CAADeyWhiMFo+Ayv2fzWbZfkPi+97LLpzQR3koMAaXv2KgzL_Dw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Sorry, I probably had to call:
# EXPLAIN SELECT ARRAY_AGG(hashed)
FROM words_nouns
WHERE EXTRACT(EPOCH FROM added) > 0
UNION
SELECT ARRAY_AGG(hashed)
FROM words_verbs
WHERE EXTRACT(EPOCH FROM added) > 0
;
QUERY PLAN
---------------------------------------------------------------------------------------------
Unique (cost=2707.03..2707.04 rows=2 width=32)
-> Sort (cost=2707.03..2707.03 rows=2 width=32)
Sort Key: (array_agg(words_nouns.hashed))
-> Append (cost=1740.53..2707.02 rows=2 width=32)
-> Aggregate (cost=1740.53..1740.54 rows=1 width=32)
-> Seq Scan on words_nouns (cost=0.00..1684.66
rows=22348 width=32)
Filter: (date_part('epoch'::text, added) >
'0'::double precision)
-> Aggregate (cost=966.45..966.46 rows=1 width=32)
-> Seq Scan on words_verbs (cost=0.00..936.05
rows=12157 width=32)
Filter: (date_part('epoch'::text, added) >
'0'::double precision)
(10 rows)
but still not sure if this statement is ok performancewise...
Regards
Alex
| From | Date | Subject | |
|---|---|---|---|
| Next Message | rakeshkumar464 | 2017-10-30 13:48:45 | starting PG command line options vs postgresql.con |
| Previous Message | Aron Widforss | 2017-10-30 11:29:57 | Re: Fwd: SPI_palloc problem |