Re: [PERFORM] query of partitioned object doesnt use index in qa

2017-09-25 Thread Mike Broers
On Wed, Sep 20, 2017 at 6:05 PM, David Rowley wrote: > On 21 September 2017 at 04:15, Mike Broers wrote: > > Ultimately I think this is just highlighting the need in my environment > to > > set random_page_cost lower (we are on an SSD SAN anyway..), but I dont > think > &

Re: [PERFORM] query of partitioned object doesnt use index in qa

2017-09-20 Thread Mike Broers
andom_page_cost lower (we are on an SSD SAN anyway..), but I dont think I have a satisfactory reason by the row estimates are so bad in the QA planner and why it doesnt use that partition index there. On Fri, Sep 15, 2017 at 3:59 PM, Mike Broers wrote: > That makes a lot of sense, thanks for

Re: [PERFORM] query of partitioned object doesnt use index in qa

2017-09-15 Thread Mike Broers
exists (select 1 from t_sap where e.landing_id = t_sap.landing_id)) as rankings; Based on the difference in row estimate I am attempting an analyze with a higher default_statistic_target (currently 100) to see if that helps. On Fri, Sep 15, 2017 at 3:42 PM, Tom Lane wrote: > Mike Broers wri

Re: [PERFORM] query of partitioned object doesnt use index in qa

2017-09-15 Thread Mike Broers
Buckets: 1024 Batches: 1 Memory Usage: 10kB │ │ -> HashAggregate (cost=41.88..43.88 rows=200 width=4) (actual time=0.054..0.067 rows=45 loops=1) │ │ Group Key: t_sap.landing_id │ │ -> Seq Sca

Re: [PERFORM] query of partitioned object doesnt use index in qa

2017-09-14 Thread Mike Broers
2017 at 08:28, Mike Broers wrote: > > I have a query of a partitioned table that uses the partition index in > > production but uses sequence scans in qa. The only major difference I > can > > tell is the partitions are much smaller in qa. In production the > partitions

[PERFORM] query of partitioned object doesnt use index in qa

2017-09-13 Thread Mike Broers
Postgres 9.5 I have a query of a partitioned table that uses the partition index in production but uses sequence scans in qa. The only major difference I can tell is the partitions are much smaller in qa. In production the partitions range in size from around 25 million rows to around 60 million

Re: [PERFORM] query against single partition uses index, against master table does seq scan

2016-09-21 Thread Mike Broers
it may become a more frequent ad-hoc need so if there is something else I can do it would be appreciated. On Wed, Sep 21, 2016 at 9:11 PM, Tom Lane wrote: > Mike Broers writes: > > Hello, I am curious about the performance of queries against a master > table > > that seem to do

Re: [PERFORM] query against single partition uses index, against master table does seq scan

2016-09-21 Thread Mike Broers
plan by using a subquery on the indexed partition and using those results to scan for the unindexed value. On Wed, Sep 21, 2016 at 12:37 PM, Mike Broers wrote: > Thanks for your response - Is 'selectively choosing what partition' > different than utilizing each partitions index wh

Re: [PERFORM] query against single partition uses index, against master table does seq scan

2016-09-21 Thread Mike Broers
uld help, but its just my wish. > > > > Regards, > Ganesh Kannan > > > > ------ > *From:* pgsql-performance-ow...@postgresql.org postgresql.org> on behalf of Mike Broers > *Sent:* Wednesday, September 21, 2016 12:53 PM > *To:* pgsql-performance@postgresql.org

[PERFORM] query against single partition uses index, against master table does seq scan

2016-09-21 Thread Mike Broers
Hello, I am curious about the performance of queries against a master table that seem to do seq scans on each child table. When the same query is issued at a partition directly it uses the partition index and is very fast. The partition constraint is in the query criteria. We have non overlappin

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

2015-07-07 Thread Mike Broers
After bumping up work_mem from 12MB to 25MB that last materialize is indeed hashing and this cut the query time by about 60%. Thanks, this was very helpful and gives me something else to look for when troubleshooting explains. On Tue, Jul 7, 2015 at 11:10 AM, Mike Broers wrote: > Tha

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

2015-07-07 Thread Mike Broers
Thanks, very informative! I'll experiment with work_mem settings and report back. On Tue, Jul 7, 2015 at 11:02 AM, Tom Lane wrote: > Mike Broers writes: > > I had a query that was filtering with a wildcard search of a text field > for > > %SUCCESS%. The query took

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

2015-07-07 Thread Mike Broers
I had a query that was filtering with a wildcard search of a text field for %SUCCESS%. The query took about 5 seconds and was running often so I wanted to improve it. I suggested that the engineers include a new boolean column for successful status. They implemented the requested field, but the q

Re: [PERFORM] poor performance when recreating constraints on large tables

2011-06-06 Thread Mike Broers
. this is a good start, if there are any other suggestions please let me know - is there any query to check estimated time remaining on long running transactions? On Mon, Jun 6, 2011 at 3:37 PM, Tom Lane wrote: > Mike Broers writes: > > I am in the process of implementing cascade

[PERFORM] poor performance when recreating constraints on large tables

2011-06-06 Thread Mike Broers
I originally posted this on admin, but it was suggested to post it to performance so here goes - I am in the process of implementing cascade on delete constraints retroactively on rather large tables so I can cleanly remove deprecated data. The problem is recreating some foreign key constraints o

Re: [PERFORM] plan question - query with order by and limit not choosing index depends on size of limit, table

2011-01-14 Thread Mike Broers
Thanks Robert, this is what I was looking for. I will try these suggestions and follow up if any of them are the silver bullet. On Fri, Jan 14, 2011 at 7:11 AM, Robert Haas wrote: > On Thu, Jan 6, 2011 at 4:36 PM, Mike Broers wrote: > > Thanks for the assistance. > > Here is an

Re: [PERFORM] plan question - query with order by and limit not choosing index depends on size of limit, table

2011-01-10 Thread Mike Broers
, table Try order by created_at+0 On Thu, Jan 6, 2011 at 3:36 PM, Mike Broers wrote: > Thanks for the assistance. > > Here is an explain analyze of the query with the problem limit: > > production=# explain analyze select * from landing_page.messages where > ((messages.topi

Re: [PERFORM] plan question - query with order by and limit not choosing index depends on size of limit, table

2011-01-06 Thread Mike Broers
, this particular table is about 1.6GB and growing. Currently there are jobs that query from this table every minute. Thanks again Mike On Wed, Jan 5, 2011 at 5:10 PM, Kevin Grittner wrote: > Mike Broers wrote: > > > Hello performance, I need help explaining the performance of

[PERFORM] plan question - query with order by and limit not choosing index depends on size of limit, table

2011-01-05 Thread Mike Broers
Hello performance, I need help explaining the performance of a particular query: select * from messages where ((messages.topic = E'/x') AND (messages.processed = 'f')) ORDER BY messages.created_at ASC limit 10; Table Structure: Column |Type | Modifiers +