Reputation
11,849
Next tag badge:
686/1000 score
213/200 answers
Badges
7 32 55
Newest
 Revival
Impact
~591k people reached

Jan
11
comment psql variable holding text with multiple lines
psql commands are oneliners (including \copy, being the only one that annoys me regularly). If you tell us the purpose of this, we might come up with a better idea.
Jan
9
comment Recovery from Live to a new Slave Server - PostgreSQL - ERROR
I have a feeling you've run into the limitations that are mentioned at postgresql.org/docs/9.2/static/app-pgbasebackup.html
Jan
8
comment Why does adding a smallint column to a postgres query increase execution time 60X?
This hash is only slightly slower than the fast one (well, about double the time, but it's only 50 ms). The real difference shows itself in the Hash Right Join node - also, one smallint in the 10+ column list cannot cause such a big change, in my view.
Jan
7
comment SSAS cube process time increased after making fact and dimension small
@Zerotoinfinity when seeing the word 'optimizing', one usually expects an actual query execution plan. Could you add one to your question?
Jan
7
comment Why does adding a smallint column to a postgres query increase execution time 60X?
@a_horse_with_no_name also the hashing that precedes that join has an enormous amount of batches. It seems that work_mem is very limiting in the second case - no idea why (if the tuple width estimation if the planner is correct).
Jan
7
comment Index not used with `=any()` but used with `in`
A minor addition: while a short IN(...) list may be translated (by the planner) into an ... OR ... expression in the above case, it is usually just translated into ANY('{...}'), that is, using an array. So, in most cases, IN with a list of values and ANY with an array are the same thing.
Jan
7
comment What is the overhead for varchar(n)?
Why not set up a small test and measure?
Jan
6
comment Simplest filesystem backup of Postgres database
The part you cited above states you need the WALs that are created from the pg_start_backup() call. What exactly do you mean by ' to revisit the filesystem (for the final step above) isn't possible'?
Jan
5
comment Deadlock best practices
IIRC with leaving all these settings at their respective defaults, deadlocks resolve themselves pretty quick. Have to have a closer look at our logs to say something more concrete. However, dealing with deadlocks is always better done by ensuring that all queries process their input in the same order - meaning not trying to resolve the deadlocks when they happen but prevent them.
Jan
5
comment Postgresql Streaming Replication Error: WAL segment removed
_'If you use streaming replication without file-based continuous archiving, the server might recycle old WAL segments before the standby has received them. ... You can avoid this by setting wal_keep_segments to a value large enough to ensure that WAL segments are not recycled too early, or by configuring a replication slot for the standby. If you set up a WAL archive that's accessible from the standby, these solutions are not required...' - from postgresql.org/docs/9.4/static/…
Jan
5
comment Multiple database directories with postgresql
@Donato could you please accept your answer as the solution? This way the question wouldn't pop up from time to time as unanswered.
Dec
26
comment SQL Server 2014 SP1 Setup Freezes Removing Temporary Files On Windows 10 x64
How do you decide which are the first two?
Dec
23
comment Postgres 9.4 won't accept remote connections
Are you using an SSL connection? What do you see in the DB logs?
Dec
22
comment Problem with EXEC MyLinkedServer…sp_executesql within transaction
You can edit your existing answer if you want to add something. Please remove this answer, moving the contents into the other one.
Dec
21
comment SUM of ever increasing column
Why do you need the coalesce()s? It is highly unlikely that either value is NULL. Also, out of curiosity, do you often use RIGHT JOIN? I see (and use, except one case) only LEFT JOINs everywhere.
Dec
21
comment SUM of ever increasing column
By 'basic sum', do you mean you add up everything you have (without a WHERE)?
Dec
18
comment pg_stat_statements not found even with "shared_preload_libraries = 'pg_stat_statements'
Have you actually installed the extension? (You can check this using \dx in psql.)
Dec
18
comment Understanding row estimation for timestamp in postgresql
What do you see when passing '2014-11-12' to the query?
Dec
17
comment Is PostgreSQL text really that much faster than Oracle CLOB?
Furthermore, there is a chance you are comparing apples to pears.
Dec
16
comment Reset postgres password v9.1
Are you sure you edited the right pg_hba.conf file? or connecting to the right PostgreSQL instance?