Re: [PERFORM] Many-to-many performance problem

2016-06-10 Thread Tom Lane
the performance you paid for. You might be able to ameliorate matters by raising shared_buffers, but unless your database isn't growing that approach has limited future. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)

Re: [PERFORM] array size exceeds the maximum allowed (1073741823) when building a json

2016-06-08 Thread Tom Lane
interest the OP's results on other JSON processors that have no issues with GB-sized JSON strings. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Locking concurrency: select for update vs update

2016-06-07 Thread Tom Lane
er you're trying to change the row's key fields, and it will proceed if you aren't. SELECT FOR UPDATE has to lock the whole row (since it must assume you might be intending to change any fields of the row); so it blocks until the FK lock goes away. regards, tom lane -- Sent

Re: [PERFORM] index fragmentation on insert-only table with non-unique column

2016-06-05 Thread Tom Lane
? How? The index ordering has nothing to do with the order in which heap tuples will be visited. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Re: Planner chooses slow index heap scan despite accurate row estimates

2016-05-27 Thread Tom Lane
While a GIN array index supports that, it's not exactly its strong suit: the sort of questions that index type supports well are more like "which arrays contain value X?". I wonder if it'd be worth creating btree indexes on the array column. regards, tom lan

Re: [PERFORM] Planner chooses slow index heap scan despite accurate row estimates

2016-05-27 Thread Tom Lane
rt to the main table. The second choice is probably preferable; doing bulk GIN inserts without fastupdate is kind of expensive itself. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription:

Re: [PERFORM] Performance problems with 9.2.15

2016-05-27 Thread Tom Lane
moving only to 9.2 and not something more recent.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] index fragmentation on insert-only table with non-unique column

2016-05-24 Thread Tom Lane
insertion point would become deterministic. I am not sure if that's good or bad for insertion performance, but it would likely help for scan performance. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make change

Re: [PERFORM] LIKE pattern

2016-05-12 Thread Tom Lane
the index. With a reasonably late-model PG (9.4+), you might well have better luck with a regular-expression pattern than a LIKE pattern, because more work has been put into pg_trgm's heuristics for choosing which trigrams to use for regexes. (Not sure why it didn't occur to us to make that code appl

Re: [PERFORM] Adding a ROLLUP switches to GroupAggregate unexpectedly

2016-03-31 Thread Tom Lane
. I don't know if that's for lack of round tuits or because it's actually hard, but it's not the planner's fault. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [PERFORM] Searching GIN-index (FTS) and sort by timestamp-column

2016-03-20 Thread Tom Lane
Andreas Joseph Krogh <andr...@visena.com> writes: > På torsdag 17. mars 2016 kl. 18:20:23, skrev Tom Lane <t...@sss.pgh.pa.us > FWIW, the reason for that is that the int8_ops operator class that > btree_gin creates doesn't contain any cross-type operators.  Probably >

Re: [PERFORM] Searching GIN-index (FTS) and sort by timestamp-column

2016-03-19 Thread Tom Lane
y to use the index at all for sorting? No. > 4. It doesn't seem like ts_rank uses the index for sorting either. Same reason. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.po

Re: [PERFORM] Merge joins on index scans

2016-03-13 Thread Tom Lane
James Parks <james.pa...@meraki.net> writes: > On Mon, Feb 29, 2016 at 5:22 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> The other explain shows a scan of "a" reading about 490k rows and >> returning 395 of them, so there's a factor of about 200 re-read here. &

Re: [PERFORM] Odd behavior with indices

2016-03-04 Thread Tom Lane
Merlin Moncure <mmonc...@gmail.com> writes: > On Mon, Feb 29, 2016 at 12:47 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> FWIW, PG >= 9.5 will ignore a LIMIT 1 inside an EXISTS, so that you get >> the same plan with or without it. But that does act as an optimizatio

Re: [PERFORM] Merge joins on index scans

2016-02-29 Thread Tom Lane
if that indexscan was estimated at 26163.20 units, how'd the mergejoin above it get costed at only 7850.13 units? The answer has to be that the planner thought the merge would stop before reading most of "a", as a result of limited range of b.a_id. It would be interesting to look into what

Re: [PERFORM] Odd behavior with indices

2016-02-29 Thread Tom Lane
and it caps some optimizations > available for EXISTS, you'd better avoid it and see if you get a proper > semi-join plan then. FWIW, PG >= 9.5 will ignore a LIMIT 1 inside an EXISTS, so that you get the same plan with or without it. But that does act as an optimization fence in earlie

Re: [PERFORM] [GENERAL] Why Postgres use a little memory on Windows.

2016-02-20 Thread Tom Lane
ly one row for each outer row, which makes me wonder if the BETWEEN couldn't be replaced with some sort of equality. But that might take some rethinking of the data. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to y

Re: [PERFORM] gin performance issue.

2016-02-05 Thread Tom Lane
ushed when it exceeds work_mem. (Obviously, using a large work_mem setting makes this worse.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] bad COPY performance with NOTIFY in a trigger

2016-02-04 Thread Tom Lane
y. You would have a lot of other performance issues with sending hundreds of thousands of distinct notify events from one transaction anyway, so I can't get terribly excited about this. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postg

Re: [PERFORM] Bitmap and-ing between btree and gin?

2016-02-04 Thread Tom Lane
onditions. You might see if you can improve the statistics for the search_vector column. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] View containing a recursive function

2016-02-01 Thread Tom Lane
le Scan on func f (cost=0.00..0.20 rows=10 width=4) which looks hairier, but that's because the function has been inlined which is usually what you want for a SQL-language function. The join is happening the way you want. regards, tom lane -- Sent via pgsql-performan

Re: [PERFORM] High Planning Time

2016-01-22 Thread Tom Lane
fix this would be appreciated. > This is odd. > Could you profile the backend during such a statement to see where the time > is spent? I'm wondering about locks. Perhaps turning on log_lock_waits would yield useful info. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Queries intermittently slow

2016-01-07 Thread Tom Lane
y attempt to correlate the slow queries with spikes in load average, swap activity, etc? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Queries intermittently slow

2016-01-07 Thread Tom Lane
sure whether modern kernels have improved this area. I think you can get an idea of how big a problem you have by noting the accumulated runtime of the khugepaged daemon. (BTW, it would likely be a good thing to collect some current wisdom in this area and add it to section 17.4 of our docs.)

Re: [PERFORM] Queries intermittently slow

2016-01-06 Thread Tom Lane
fied I/O bandwidth? > I will look at changing the deadlock_timeout, but that might have to wait for > the weekend since this is a production system. You needn't restart the server for that, just edit postgresql.conf and SIGHUP the postmaster. regards, tom lane -- Sent

Re: [PERFORM] Queries intermittently slow

2016-01-06 Thread Tom Lane
eanup but we can't tell on the basis of this much info. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Queries intermittently slow

2016-01-06 Thread Tom Lane
Scott Rankin <sran...@motus.com> writes: > On 1/6/16, 10:38 AM, "Tom Lane" <t...@sss.pgh.pa.us> wrote: >> A possible theory is that the slow cases represent times when the desired >> page is not in cache, but you'd have to have a seriously overloaded disk

Re: [PERFORM] Queries intermittently slow

2016-01-06 Thread Tom Lane
t;hot" and unswappable from the kernel's perspective). Or reduce the number of active backend processes. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Plan differences

2015-12-31 Thread Tom Lane
n't want to rebuild the whole database, you can create indexes to support this by declaring them with COLLATE "C", or the older way is to declare them with text_pattern_ops as the index opclass. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-per

Re: [PERFORM] Plan differences

2015-12-31 Thread Tom Lane
Jim Nasby <jim.na...@bluetreble.com> writes: > On 12/31/15 9:02 AM, Tom Lane wrote: >> If you don't want to rebuild the whole database, you can create indexes to >> support this by declaring them with COLLATE "C", or the older way is to >> declare them with

Re: [PERFORM] Selectivity for lopsided foreign key columns

2015-12-17 Thread Tom Lane
a two-column foreign key constraint on (id, tag).) Then the query would look like SELECT * FROM t1 INNER JOIN t2 ON t1.tag = t2.tag WHERE t2.tag = '' and since the planner is smart enough to deduce t1.tag = '' from that, it would arrive at the correct estimate for any particular tag.

Re: [PERFORM] Terrible plan choice for view with distinct on clause

2015-12-17 Thread Tom Lane
an() without too much overhead. I'm not feeling motivated to work on this myself, absent a more convincing explanation of why we should expend any effort to support this query pattern. But if anyone else is, have at it. regards, tom lane -- Sent via pgsql-performance mai

Re: [PERFORM] Getting an optimal plan on the first execution of a pl/pgsql function

2015-12-14 Thread Tom Lane
t of time, use a connection pooler to do it for you (pgpooler for instance). regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Query that took a lot of time in Postgresql when not using trim in order by

2015-11-29 Thread Tom Lane
regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Index scan cost calculation

2015-11-26 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Index scan cost calculation

2015-11-26 Thread Tom Lane
Glyn Astill <glynast...@yahoo.co.uk> writes: >> From: Tom Lane <t...@sss.pgh.pa.us> >> The problem will probably go away by itself as your table grows, but >> if you don't want to wait, you might want to reflect on which of the index >> columns might be

Re: [PERFORM] No index only scan on md5 index

2015-11-25 Thread Tom Lane
be large, that's not going to be a workable hack for your case. Probably the only thing that's going to work for you is to store md5(attachment_bytes) in its own plain column (you can use a trigger to compute it for you), and then build a regular index on that, and query for that column not the md5() e

Re: [PERFORM] Why is now()::date so much faster than current_date

2015-11-17 Thread Tom Lane
ompliant RDBMS. And it's just ugly at a code level too: the raw grammar is not the place to encode implementation decisions like these. I've had it on my to-do list for awhile to replace those things with some new expression node type, but haven't got round to it. regards, tom

Re: [PERFORM] Simple delete query is taking too long (never ends)

2015-11-12 Thread Tom Lane
ok more like create table foo(i integer primary key); create table bar(j integer primary key, i integer references foo); create index on bar(i); which would provoke the warning. I fear a warning like that would have a very short life expectancy. regards, tom lane

Re: [PERFORM] Simple delete query is taking too long (never ends)

2015-11-12 Thread Tom Lane
Merlin Moncure <mmonc...@gmail.com> writes: > On Wed, Nov 11, 2015 at 1:33 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> If you're not sure which table is the problem, try doing an EXPLAIN >> ANALYZE of a DELETE that will only remove a few rows. You should >>

Re: [PERFORM] Simple delete query is taking too long (never ends)

2015-11-11 Thread Tom Lane
r associated with the FK constraint. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Slow 3 Table Join with v bad row estimate

2015-11-10 Thread Tom Lane
y choose to use these indexes in its plan; but their existence will prompt ANALYZE to gather stats about the expression results, and that should at least let the planner draw more-accurate conclusions about the selectivity of the equality constraint. regards, tom lane -- Sen

Re: [PERFORM] Slow 3 Table Join with v bad row estimate

2015-11-10 Thread Tom Lane
ondition could be enforced at the inner indexscan instead of the join. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] querying jsonb for arrays inside a hash

2015-11-07 Thread Tom Lane
y that the first query matched 135843 rows and the second one none at all, so a significant variation in runtime doesn't seem that surprising to me ... regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to yo

Re: [PERFORM] Slow query in trigger function

2015-11-02 Thread Tom Lane
l us whether or not a different plan is being used for the query inside the function. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Slow query in trigger function

2015-11-02 Thread Tom Lane
IT clauses inside EXISTS(), because people keep writing them even though they're useless. Earlier releases do not have that code though.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Query optimizer plans with very small selectivity estimates

2015-10-29 Thread Tom Lane
been prior discussion along the same lines as you mention (only believe 1-row estimates when it's provably true that there's at most one row), but it hasn't looked like an easy change. See the pgsql-hackers archives for previous threads. regards, tom lane -- Sent via pgs

Re: [PERFORM] Query planner wants to use seq scan

2015-10-27 Thread Tom Lane
all the conditions can be checked in the index. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] query partitioned table is very slow

2015-10-16 Thread Tom Lane
me will kill you. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] LIMIT 1 poor query plan

2015-10-10 Thread Tom Lane
haky because it's hard to predict how many rows will get skipped before finding one with b_id=42. If you do this type of query often enough to care about its performance, you could consider creating a two-column index on (b_id, created) (in that order). regards, tom l

Re: [PERFORM] Long running query: How to monitor the progress

2015-08-25 Thread Tom Lane
this? You could watch how fast the target table is physically growing, perhaps. Or I think contrib/pgstattuple could be used to count uncommitted tuples in it. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes

Re: [PERFORM] Performance bottleneck due to array manipulation

2015-08-21 Thread Tom Lane
that these are bigints, so that won't work. regards, tom lane from The array manipulation part is the performance bottleneck. I am pretty sure, that there is a better way of doing this, however I couldn't find one. What I have is two

Re: [PERFORM] Are many idle connections bad?

2015-07-25 Thread Tom Lane
be a lot better off with a pooler. (There has been, and continues to be, interest in getting rid of this bottleneck ... but it's a problem in all existing Postgres versions.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org

Re: [PERFORM] Hmmm... why does CPU-intensive pl/pgsql code parallelise so badly when queries parallelise fine? Anyone else seen this?

2015-07-08 Thread Tom Lane
plpgsql code out there, and it can make a huge difference for that. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] wildcard text filter switched to boolean column, performance is way worse

2015-07-07 Thread Tom Lane
a better plan, but it's worth trying if it wouldn't require too much app-side contortion. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [PERFORM] 9.5alpha1 vs 9.4

2015-07-05 Thread Tom Lane
... regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Sudden connection and load average spikes with postgresql 9.3

2015-06-30 Thread Tom Lane
on OS-level disk caching. Some have found that very large shared buffer pools tend to increase contention without much payback. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http

Re: [PERFORM] Slow hash join performance with many batches

2015-06-01 Thread Tom Lane
. Hard to opine further since no details about the CTEs were provided. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Different plan for very similar queries

2015-05-31 Thread Tom Lane
that particular misbehavior? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Different plan for very similar queries

2015-05-31 Thread Tom Lane
(see the impact of loop_count on cost_index). regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Different plan for very similar queries

2015-05-30 Thread Tom Lane
, this would all be moot if the cost estimate for the nestloop plan were nearer to reality. Since you started a separate -hackers thread for that issue, let's go discuss that there. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org

Re: [PERFORM] MAX() and multi-column index on a partitioned table?

2015-05-22 Thread Tom Lane
or newer should know how to do this with a merge append of several indexscans. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] MAX() and multi-column index on a partitioned table?

2015-05-22 Thread Tom Lane
Dave Johansen davejohan...@gmail.com writes: On Fri, May 22, 2015 at 3:42 PM, Tom Lane t...@sss.pgh.pa.us wrote: What PG version are you using? 9.1 or newer should know how to do this with a merge append of several indexscans. Sorry, I should have mentioned that in the original email. I'm

Re: [PERFORM] union all and filter / index scan - seq scan

2015-05-21 Thread Tom Lane
than you've let on. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] extract(year from date) doesn't use index but maybe could?

2015-04-19 Thread Tom Lane
worth saving users from hand-optimizing such cases depends a lot on what it's going to cost in added planning time for queries that don't get any benefit. This example doesn't look like a case that's going to win that cost/benefit tradeoff comparison. regards, tom lane

Re: [PERFORM] extract(year from date) doesn't use index but maybe could?

2015-04-19 Thread Tom Lane
and not expect to scan too many index items that don't satisfy the original extract() condition. But I don't see how to make something like that work for mapping case-insensitive searches onto case-sensitive indexes. regards, tom lane -- Sent via pgsql-performance mailing list

Re: [PERFORM] Weird CASE WHEN behaviour causing query to be suddenly very slow

2015-03-31 Thread Tom Lane
approach. At the very least, if you need a many-armed CASE, it behooves you to make sure the common cases appear early. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http

Re: [PERFORM] views much slower in 9.3 than 8.4

2015-03-30 Thread Tom Lane
Kevin Grittner kgri...@ymail.com writes: Tom Lane t...@sss.pgh.pa.us wrote: But the other problem is that the planner considers less-than-1% differences in cost estimates to be in the noise, which means that it's not going to consider cost differences of less than 1480 units in the remaining

Re: [PERFORM] views much slower in 9.3 than 8.4

2015-03-28 Thread Tom Lane
.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Index only scan sometimes switches to sequential scan for small amount of rows

2015-03-25 Thread Tom Lane
not in the list. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] views much slower in 9.3 than 8.4

2015-03-19 Thread Tom Lane
allocations.resource_id regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Merge Join chooses very slow index scan

2015-03-19 Thread Tom Lane
it actually is a significant win. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Merge Join chooses very slow index scan

2015-03-19 Thread Tom Lane
immediately when it's exhausted the rows with type = 'vehicle'. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: Fwd: [PERFORM] views much slower in 9.3 than 8.4

2015-03-18 Thread Tom Lane
suspicious that the underlying cause might have to do with recent versions being warier about optimizing sub-selects containing volatile functions than 8.4 was. However, that theory doesn't seem to explain the horribly bad join size estimates you're showing. regards, tom lane

Re: [PERFORM] Bad cost estimate with FALSE filter condition

2015-03-16 Thread Tom Lane
apply at the top plan level so they're unlikely to change any planner choices. Moreover, for any case other than the not-terribly-interesting constant FALSE case, we're better off assuming that the filter condition will be true (and so there's nothing to adjust). regards, tom

Re: [PERFORM] Postgres inconsistent use of Index vs. Seq Scan

2015-03-13 Thread Tom Lane
% of your table has vid = 1, then there would be some point in trying to use an index to find the other 1%; but you'll have to formulate the query differently (perhaps vid 1 would do?) or else use a properly-designed partial index. regards, tom lane -- Sent via pgsql

Re: [PERFORM] EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT

2015-03-12 Thread Tom Lane
the planner's viewpoint it'd be easy enough to fall back to using whatever it had in the histogram after all. But that's all happening down inside index_getnext, and I'm hesitant to stick some kind of wart into that machinery for this purpose. regards, tom lane -- Sent via

Re: [PERFORM] EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT

2015-03-06 Thread Tom Lane
is showing any stress. Dead rows should be a hazard for anything, especially if there are enough of them to require hours to re-hint. And why wouldn't autovacuum get to them first? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance

Re: [PERFORM] EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT

2015-03-06 Thread Tom Lane
Tomas Vondra tomas.von...@2ndquadrant.com writes: On 6.3.2015 01:44, Tom Lane wrote: I'm wondering about the issue addressed by commit fccebe421 (Use SnapshotDirty rather than an active snapshot to probe index endpoints). How would fccebe421 explain the large amount of random writes (~4MB/s

Re: [PERFORM] EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT

2015-03-05 Thread Tom Lane
'), that'd be useful. Without some more-precise idea of where the time is going, we're really just guessing as to the cause. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http

Re: [PERFORM] Reverse Key Index

2015-02-14 Thread Tom Lane
built-in for that (and frankly, it doesn't sound useful enough that we'd ever add it). You could get the effect easily enough with an expression index on a byte-reversing function. A related thing that people often do is create an index on a hash function. regards, tom

Re: [PERFORM] query - laziness of lateral join with function

2015-02-12 Thread Tom Lane
in the formulation of the submitted query. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] slow query

2015-02-11 Thread Tom Lane
, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Avoiding Refreezing XIDs Repeatedly

2015-02-09 Thread Tom Lane
then they should not be changing once the tuples have been frozen the first time. If this is incurring continuing rsync work then something else is going on. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your

Re: [PERFORM] Copy command Faster than original select

2015-02-06 Thread Tom Lane
after that to format and display the query result. PGAdmin is probably measuring the query time differently. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [PERFORM] Why is GIN index slowing down my query?

2015-02-01 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Unexpected (bad) performance when querying indexed JSONB column

2015-02-01 Thread Tom Lane
...) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Why is GIN index slowing down my query?

2015-02-01 Thread Tom Lane
of thumb would work better :-( regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Why is PostgreSQL not using my index?

2015-01-26 Thread Tom Lane
on the basis of a single example; you might find that it makes other plan choices worse. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] How to tell ANALYZE to collect statistics from the whole table?

2015-01-24 Thread Tom Lane
by taking enormously large samples would be the number-of-distinct-values estimate. There's already a way you can override ANALYZE's estimate of that number if you need to. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make

Re: [PERFORM] shared_buffers vs Linux file cache

2015-01-15 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Strange choice of general index over partial index

2015-01-15 Thread Tom Lane
in index size. Have you neglected to mention some nondefault planner cost settings? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Strange choice of general index over partial index

2015-01-15 Thread Tom Lane
much to do with reality for this specific query.) regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Excessive memory used for INSERT

2014-12-23 Thread Tom Lane
about that. In the meantime, if you want to stick with this partitioning design, couldn't you improve that code so the UPDATE is only applied to the one child table it's needed for? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance

Re: [PERFORM] Excessive memory used for INSERT

2014-12-18 Thread Tom Lane
an investigatable problem statement. I will note that EXCEPTION blocks aren't terribly cheap, so if you're reaching the EXECUTE sql_insert a lot of times that might have something to do with it. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance

Re: [PERFORM] Question about trigram GIST index

2014-12-18 Thread Tom Lane
with the former as being more understandable to someone who knows standard SQL. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Excessive memory used for INSERT

2014-12-17 Thread Tom Lane
. Alternatively, you might want to reconsider the concept of updating hundreds of millions of rows in a single operation ... regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http

Re: [PERFORM] Excessive memory used for INSERT

2014-12-17 Thread Tom Lane
? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Re: [SQL] querying with index on jsonb slower than standard column. Why?

2014-12-12 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] Re: [SQL] querying with index on jsonb slower than standard column. Why?

2014-12-12 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 12/12/2014 04:44 PM, Tom Lane wrote: Well, it'd be easy to fix if we were willing to invent distinct operators depending on which type you wanted out (perhaps - for text output as today, add -# for numeric output, etc). That was my immediate

<    1   2   3   4   5   6   7   8   9   10   >