Re: [PERFORM] unlogged tables

2011-11-14 Thread Anibal David Acosta
n Grittner [mailto:kevin.gritt...@wicourts.gov] Enviado el: lunes, 14 de noviembre de 2011 02:27 p.m. Para: 'Richard Huxton'; Anibal David Acosta; 'Sergey Konoplev' CC: pgsql-performance@postgresql.org; 'Stephen Frost' Asunto: Re: [PERFORM] unlogged tables "Anibal D

[PERFORM] autovacuum, any log?

2011-12-07 Thread Anibal David Acosta
Hello, I have a postgres 9.0.2 installation. Every works fine, but in some hours of day I got several timeout in my application (my application wait X seconds before throw a timeout). Normally hours are not of intensive use, so I think that the autovacuum could be the problem. Is threre any l

[PERFORM] autovacuum, exclude table

2011-12-12 Thread Anibal David Acosta
I have a couple of tables with about 400millions of records increasing about 5 millions per day. I think that disabling autovac over those tables, and enabling daily manual vacuum (in some idle hour) will be better. I am right? Is possible to exclude autovacuum over some tables? Tha

Re: [PERFORM] autovacuum, exclude table

2011-12-12 Thread Anibal David Acosta
...@ringerc.id.au] Enviado el: lunes, 12 de diciembre de 2011 11:45 a.m. Para: Anibal David Acosta CC: pgsql-performance@postgresql.org Asunto: Re: [PERFORM] autovacuum, exclude table Top-posting because this is context free: You need to provide more info for anybody to help you. Are the tables

[PERFORM] auto vacuum, not working?

2012-01-13 Thread Anibal David Acosta
Hi, yesterday I delete about 200 million rows of a table (about 150GB of data), after delete completes the autovacuum process start. The autovacuum is running for about 11 hours but no space is released Autovacuum parameters are with default values in postgresql.conf The postgres version is

[PERFORM] pgstat wait timeout

2012-07-27 Thread Anibal David Acosta
In my postgres log I saw a lot of warning like this. WARNING: pgstat wait timeout Every 10 seconds aprox since yesterday and after one year working without any warning I have postgres 9.0.3 on a Windows Server 2008 R2. I have only one big table with aprox. 1,300,000,000 (yes 1,300

Re: [PERFORM] pgstat wait timeout

2012-07-27 Thread Anibal David Acosta
More information. After many "WARNING: pgstat wait timeout" in the log also appear "ERROR: canceling autovacuum task " De: Anibal David Acosta [mailto:a...@devshock.com] Enviado el: viernes, 27 de julio de 2012 06:04 p.m. Para: pgsql-performance@postgresq

[PERFORM] best practice to avoid table bloat?

2012-08-16 Thread Anibal David Acosta
Hi, if I have a table that daily at night is deleted about 8 millions of rows (table maybe has 9 millions) is recommended to do a vacuum analyze after delete completes or can I leave this job to autovacuum? This table is very active during the day but less active during night I think that

Re: [PERFORM] best practice to avoid table bloat?

2012-08-16 Thread Anibal David Acosta
on for the server condition Thanks! -Mensaje original- De: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] Enviado el: jueves, 16 de agosto de 2012 04:52 p.m. Para: Anibal David Acosta; pgsql-performance@postgresql.org Asunto: Re: [PERFORM] best practice to avoid table bloat? "Anib

[PERFORM] query performance, where goes time?

2012-09-05 Thread Anibal David Acosta
Using explain analyze I saw that many of my queries run really fast, less than 1 milliseconds, for example the analyze output of a simple query over a table with 5millions of records return "Total runtime: 0.078 ms" But the real time is a lot more, about 15 ms, in fact the pgadmin show this v

[PERFORM] how to avoid deadlock on masive update with multiples delete

2012-10-04 Thread Anibal David Acosta
Hi, I have a table with about 10 millions of records, this table is update and inserted very often during the day (approx. 200 per second) , in the night the activity is a lot less, so in the first seconds of a day (00:00:01) a batch process update some columns (used like counters) of this table

Re: [PERFORM] how to avoid deadlock on masive update with multiples delete

2012-10-05 Thread Anibal David Acosta
original- De: Claudio Freire [mailto:klaussfre...@gmail.com] Enviado el: viernes, 05 de octubre de 2012 10:27 a.m. Para: Jeff Janes CC: Anibal David Acosta; pgsql-performance@postgresql.org Asunto: Re: [PERFORM] how to avoid deadlock on masive update with multiples delete On Thu, Oct 4, 2012 at 1

[PERFORM] Do cast affects index usage?

2012-10-12 Thread Anibal David Acosta
I have a table with a column of type timestamp with time zone, this column has an index If I do a select like this select * from mytable where cast(my_date as timestamp without time zone) > '2012-10-12 20:00:00' this query will use the index over the my_date column? Thanks

Re: [PERFORM] Do cast affects index usage?

2012-10-12 Thread Anibal David Acosta
.pgh.pa.us] Enviado el: viernes, 12 de octubre de 2012 05:39 p.m. Para: Anibal David Acosta CC: pgsql-performance@postgresql.org Asunto: Re: [PERFORM] Do cast affects index usage? "Anibal David Acosta" writes: > I have a table with a column of type timestamp with time zone, this > c

Re: xfs perform a lot better than ext4 [WAS: Re: [PERFORM] Two identical systems, radically different performance]

2012-12-05 Thread Jean-David Beyer
On 12/05/2012 10:34 AM, Andrea Suisani wrote: > [sorry for resuming an old thread] > > [cut] > Question is... will that remove the performance penalty of HyperThreading? >>> >>> So I've added to my todo list to perform a test to verify this claim :) >> >> done. > > on this box: > >> in a

Re: [PERFORM] hardware upgrade, performance degrade?

2013-03-03 Thread Jean-David Beyer
On 03/03/2013 03:16 PM, Josh Berkus wrote: > Steven, > >> We saw the same performance problems when this new hardware was running >> cent 6.3 with a 2.6.32-279.19.1.el6.x86_64 kernel and when it was matched >> to the OS/kernel of the old hardware which was cent 5.8 with >> a 2.6.18-308.11.1.el5 ke

Re: [PERFORM] Best practice question

2014-04-21 Thread David G Johnston
ut whether or not that is significant enough to discard the advantages of triggers is something only you can decide - ideally after testing. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Best-practice-question-tp5801010p5801011.html Sent from the PostgreS

Re: [PERFORM] Optimize query for listing un-read messages

2014-05-01 Thread David G Johnston
How does something like: WITH unreads AS ( SELECT messageid FROM message EXCEPT SELECT messageid FROM message_property WHERE personid=1 AND has_read ) SELECT ... FROM unreads JOIN messages USING (messageid) ; perform? David J. -- View this message in context: http://postgresql.1045698.n5

Re: [PERFORM] Optimize query for listing un-read messages

2014-05-01 Thread David G Johnston
= ANY(reader_ids)) ; UPDATE message SET reader_ids = reader_ids || 1 WHERE messageid = ..." I'm not that familiar with how well indexes over arrays work or which kind is needed (i.e. gin/gist). HTH David J. -- View this message in context: http://postgresql.1045698.n5.nabble.c

Re: [PERFORM] Optimize query for listing un-read messages

2014-05-01 Thread David G Johnston
when "is_read" is true? Since you already allow for the possibility of a missing record (giving it the meaning of "not read")​ these other properties cannot currently exist in that situation. David J. -- View this message in context: http://postgresql.1045698.n5.nabble

[PERFORM] Re: PostgreSQL's query planner is using the wrong index, what can I do to improve this situation?

2014-05-04 Thread David G Johnston
multiple-column index time should probably the first listed field. The planner figures being more selective and filtering is going to be faster than scanning the much larger section of index covered by the stock_id(s) and then going and fetching those pages and then checking them for visibility.

[PERFORM] Re: recently and selectively slow, but very simple, update query....

2014-05-05 Thread David G Johnston
effect given that the symptoms are sporadic and we are only talking about a select statement that returns a single row; and an update that does not hit any indexed column and therefore benefits from "HOT" optimization. HTH David J. -- View this message in context: http://postg

[PERFORM] Re: recently and selectively slow, but very simple, update query....

2014-05-05 Thread David G Johnston
atly if you can afford it in your production environment - it would make looking for internal concurrency much easier. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Re-recently-and-selectively-slow-but-very-simple-update-query-tp5802553p5802579.html S

Re: [PERFORM] how do functions affect query plan?

2014-05-14 Thread David G Johnston
常超 wrote > Hi,all > I have a table to save received measure data. > > > CREATE TABLE measure_data > ( >   id serial NOT NULL, >   telegram_id integer NOT NULL, >   measure_time timestamp without time zone NOT NULL, >   item_id integer NOT NULL, >   val double precision, >   CONSTRAINT measure_dat

Re: [PERFORM] group commit

2014-06-04 Thread David G Johnston
ineffective as the write workload > increased, because of internal lock contention. Though based upon your question regarding parallel replication I am thinking that maybe your concept of "group commit" and the one that was implemented are quite different... David J. -- View this m

Re: [PERFORM] parse/bind/execute

2014-06-04 Thread David G Johnston
then discard the prepared statement. I do not know enough about the underlying data to draw a conclusion but typically the higher the bind/prepare ratio the more efficient your use of database resources. Same goes for the prepare ratio. The clients you use and the general usage of the database he

Re: [PERFORM] UNION and bad performance

2014-06-08 Thread David G Johnston
unction.html Note the "ROWS" property. Functions are black-boxes to the planner so it has no means of estimating a row count. So a set returning function uses 1,000 and all others use 1. Determining "COST" is similarly problematic. David J. -- View th

[PERFORM] Re: Slow query with indexed ORDER BY and LIMIT when using OR'd conditions

2014-07-21 Thread David G Johnston
t a basic level it is unable to push down LIMIT into a WHERE clause and it cannot add additional sub-queries that do not exist in the original plan - which includes adding a UNION node. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-query-with-indexed-ORD

[PERFORM] Re: Slow query with indexed ORDER BY and LIMIT when using OR'd conditions

2014-07-21 Thread David G Johnston
johno wrote > Thanks for the quick reply David! > > However I am still unsure how these two queries are not relationally > equivalent. I am struggling to find a counterexample where the first and > third query (in email, not in gist) would yield different results. Any > ideas?

[PERFORM] Re: Slow query with indexed ORDER BY and LIMIT when using OR'd conditions

2014-07-21 Thread David G Johnston
> BTW this is to my understanding a very similar scenario to how partitioned > tables work and push down limit and where conditions. Why is this not > possible in this case? > > Jano > > > On Mon, Jul 21, 2014 at 11:54 PM, David G Johnston < > david.g.johnston@ >

Re: [PERFORM] Query performing very bad and sometimes good

2014-08-05 Thread David G Johnston
le both are quite small (0.002/0.004) the 300,000+ loops do add up. The same likely applies to the other planning nodes but I didn't dig that deep. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Query-performing-very-bad-and-sometimes-good-tp5813831p5813847.h

Re: [PERFORM] two table join with order by on both tables attributes

2014-08-07 Thread David G Johnston
n by the planner - and can provide data that the developers can use to replicate the experiment - then improvements can be made. At worse you will come to understand why the planner is right and can then explore alternative models. David J. -- View this message in context: http://postgre

Re: [PERFORM] query on parent partition table has bad performance

2014-08-20 Thread David G Johnston
only available in supported versions that is not an option for you. Still, it is the most likely explanation for what you are seeing. There is time involved to process the partition constraint exclusion but I'm doubting it accounts for a full 3 seconds... David J. -- View this me

Re: [PERFORM] autocommit (true/false) for more than 1 million records

2014-08-22 Thread David G Johnston
ter advice depends on context and hardware. You should also consider upgrading to a newer, supported, version of PostgreSQL. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/autocommit-true-false-for-more-than-1-million-records-tp5815943p5815946.html Sent from the

Re: [PERFORM] autocommit (true/false) for more than 1 million records

2014-08-26 Thread David G Johnston
, and another imported was to be attempted, ideally the allocated space could be reused. I'm not sure what a reasonable formula would be, especially at the TB scale, but roughly 2x the size of the imported (uncompressed) file would be a good starting point (table + WAL). You likely would want m

Re: [PERFORM] query performance with hstore vs. non-hstore

2014-09-01 Thread David G Johnston
each twice - and note that (each(...).*) does not work to avoid the double-call - you have to use a subquery / a CTE one to ensure that it is not collapsed (offset 0 should work too but I find the CTE one a little cleaner personally). David J. -- View this message in context: http://postgresq

Re: [PERFORM] weird execution plan

2014-09-11 Thread David G Johnston
Huang, Suya wrote > Can someone figure out why the first query runs so slow comparing to the > second one? They generate the same result... Try: EXPLAIN (ANALYZE, BUFFERS) I believe you are only seeing caching effects. David J. -- View this message in context: http://postgresql.1045

Re: [PERFORM] weird execution plan

2014-09-12 Thread David G Johnston
will perform better since fewer rows must be evaluated in the less efficient count(DISTINCT) expression - the time saved there more than offset by the fact that you are effectively passing over that subset of the data a second time. HashAggregate(1M rows) + Aggregate(200k rows) < Aggregate(1M rows)

Re: [PERFORM] Slow query

2014-09-23 Thread David G Johnston
> GroupAggregate (cost=0.42..228012.62 rows=208120 width=15) (actual > time=0.042..2089.367 rows=20 loops=1) >Buffers: shared hit=53146 >-> Index Scan using t1_name on t1 (cos

Re: [PERFORM] IS NOT NULL and LEFT JOIN

2014-10-20 Thread David G Johnston
o) will generate sub-optimal plans that can be rewritten using relational algebra and better optimized for having done so. But such work takes resources that would be expended for every single query while manually rewriting the sub-optimal query solves the problem once-and-for-all. David J. -- View

Re: [PERFORM] IS NOT NULL and LEFT JOIN

2014-10-20 Thread David G Johnston
David G Johnston wrote > > Laurent Martelli wrote >> Le 20/10/2014 15:58, Tom Lane a écrit : >>> Laurent Martelli < >> laurent.martelli@ >> > writes: >>>> Do we agree that both queries are identical ? >>> No, they *aren't* id

Re: [PERFORM] Postgres does not use indexes with OR-conditions

2014-11-07 Thread David G Johnston
s query as well as pagination-oriented queries are two that come to mind. I think the material would fit well in the tutorial section but having some kind of quick synopsis and cross reference in the performance chapter would aid someone whose looking to solve a problem and not in general edu

[PERFORM] Re: Migrating a FoxPro system and would like input on the best way to achieve optimal performance

2015-02-09 Thread David G Johnston
personally choose only between having different databases for each client or using a "client_id" column in conjunction with a multi-tenant database. Those are the two logical models; everything else (e.g. partitioning) are physical implementation details. David J. -- View

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

2015-02-12 Thread David G Johnston
RAL. More detailed reports may at least bring exposure to what is being used in the wild and garner interest from other parties in improving things. Unfortunately this report is too limited to really make a dent; lacking even the name of the ORM that is being used and the entire queries that are bein

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

2015-03-31 Thread David G. Johnston
ndition probably using only 1 or 2 columns instead of all five.​ ​I'm not familiar with the caching constraint or the data so its hard to make more specific suggestions. David J.​

Re: [PERFORM] unlogged tables

2015-04-13 Thread David G. Johnston
Instead, not knowing whether there were changes since the last checkpoint, the system truncated the relation. What use case is there for a behavior that the last checkpoint data is left on the relation upon restarting - not knowing whether it was possible the other data could have been written subsequent? David J.

Re: [PERFORM] unlogged tables

2015-04-13 Thread David G. Johnston
On Mon, Apr 13, 2015 at 4:49 PM, Jeff Janes wrote: > On Mon, Apr 13, 2015 at 1:49 PM, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Monday, April 13, 2015, Matheus de Oliveira >> wrote: >> >>> >>> On Mon, Apr 13, 2015 at 4:31

Re: [PERFORM] unlogged tables

2015-04-13 Thread David G. Johnston
On Mon, Apr 13, 2015 at 7:45 PM, Jim Nasby wrote: > On 4/13/15 7:32 PM, David G. Johnston wrote:​ > > That particular use-case would probably best be served with a separate >> replication channel which pushes data files from the primary to the >> slaves and allows for t

Re: [PERFORM] Fastest way / best practice to calculate "next birthdays"

2015-05-20 Thread David G. Johnston
not affected by month boundaries but do start on Monday. David J.

Re: [PERFORM] Fastest way / best practice to calculate "next birthdays"

2015-05-21 Thread David G. Johnston
On Thursday, May 21, 2015, Bosco Rama wrote: > On 05/20/15 20:22, David G. Johnston wrote: > > On Monday, May 18, 2015, er.tejaspate...@gmail.com < > > er.tejaspate...@gmail.com > wrote: > > > >> If I have to find upcoming birthdays in current week a

Re: [PERFORM] Postgres is using 100% CPU

2015-05-31 Thread Jean-David Beyer
ou insert 273 rows at once, you are doing it as 273 transactions instead of one? -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key:166D840A 0C610C8B Registered Machine 1935521. /( )\ Shrewsbury, New Jerseyhttp://linuxcounter.net ^^-^^ 09:00:01 up 3 days, 9:57

Re: [PERFORM] How to reduce writing on disk ? (90 gb on pgsql_tmp)

2015-06-03 Thread David G. Johnston
You should repost this directly and not through Nabble. It has wrapped your code in raw tags which the PostgreSQL mailing list software strips. On Wednesday, June 3, 2015, ben.play wrote: > Hi all, > > We have a big database (more than 300 Gb) and we run a lot of queries each > minute. > > Howe

Re: [PERFORM] Are there tuning parameters that don't take effect immediately?

2015-06-12 Thread David G. Johnston
changes are worse would take effect after a reboot - though most are used on the very next query that runs. The vacuum would indeed likely account for the gains - there being significantly fewer ​dead/invisible rows to have to scan over and discard while retrieving the live rows that fulfill your query. David J.

Re: [PERFORM] Insert vs Update

2015-07-15 Thread David G. Johnston
On Wed, Jul 15, 2015 at 12:16 PM, Robert DiFalco wrote: > First off I apologize if this is question has been beaten to death. I've > looked around for a simple answer and could not find one. > > Given a database that will not have it's PKEY or indices modified, is it > generally faster to INSERT

Re: [PERFORM] Insert vs Update

2015-07-15 Thread David G. Johnston
On Wednesday, July 15, 2015, Robert DiFalco wrote: > First off I apologize if this is question has been beaten to death. I've > looked around for a simple answer and could not find one. > > Given a database that will not have it's PKEY or indices modified, is it > generally faster to INSERT or UP

Re: [PERFORM] Insert vs Update

2015-07-15 Thread David G. Johnston
On Wed, Jul 15, 2015 at 1:56 PM, Robert DiFalco wrote: > > > On Wed, Jul 15, 2015 at 10:33 AM, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Wednesday, July 15, 2015, Robert DiFalco >> wrote: >> >>> First off I apologize if

Re: [PERFORM] Insert vs Update

2015-07-15 Thread David G. Johnston
us the update would likely end up writing an entirely new​ record upon each event category recording. David J.

Re: [PERFORM] Insert vs Update

2015-07-15 Thread David G. Johnston
On Wed, Jul 15, 2015 at 4:53 PM, Michael Nolan wrote: > On Wed, Jul 15, 2015 at 3:16 PM, Robert DiFalco > wrote: > >> >> Thanks David, my example was a big simplification, but I appreciate your >> guidance. The different event types have differing amounts of related d

Re: [PERFORM] Most efficient way of querying M 'related' tables where N out of M may contain the key

2015-08-20 Thread David G. Johnston
t;UNION ALL" query you proposed. David J.

Re: [PERFORM] Most efficient way of querying M 'related' tables where N out of M may contain the key

2015-08-21 Thread David G. Johnston
On Fri, Aug 21, 2015 at 8:07 AM, Stephane Bailliez wrote: > > On Thu, Aug 20, 2015 at 8:19 PM, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> >> ​SELECT [...] >> FROM (SELECT reference_id, [...] FROM table_where_referenced_id_is_a_pk

[PERFORM] Re: [PERFORM] Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread David G. Johnston
ure if the planner could be smarter because you are asking a question it is not particularly suited to estimating - namely cross-table correlations. Rethinking the model is likely to give you a better outcome long-term though it does seem like there should be room for improvement within the stated query and model. As Tomas said you likely will benefit from increased working memory in order to make materializing and hashing/bitmapping favorable compared to a nested loop. David J.

[PERFORM] Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread David G. Johnston
ified. I'm not sure why the nested loop executor is not intelligent enough to do this... The important number in these plans is "loops", not "rows" David J.

[PERFORM] Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison

2015-08-31 Thread David G. Johnston
gt; slow to use? Is it because it involves the *date()* function call that it > makes it difficult for the planner to guess the data distribution in the > DOCUMENT table? > What happens if you pre-compute the date condition and hard code it? ​ ​David J. ​

Re: [PERFORM] Partition Constraint Exclusion Limits

2015-10-27 Thread David G. Johnston
rtitioning data has to be injected into the query explicitly so that it is already in place before the planner receives the query. Anything within the query requiring "execution" is handled by the executor and at that point the chance to exclude partitions has come and gone. David J.

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

2015-11-25 Thread David G. Johnston
stem is designed to return data from the heap, not an index. While it possibly can in some instances if you need to return data you should store it directly in the table. David J.

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

2015-12-14 Thread David G. Johnston
25..0.26 rows=1 > width=116) (actual time=0.401..0.402 rows=1 loops=1)" > "Planning time: 0.058 ms" > "Execution time: 0.423 ms" > > ​I'm doubting the query inside of the function is the problem here...it is the function usage itself. Calling a function has overhead in that the body of function needs to be processed. This only has to happen once per session. The first call of the function incurs this overhead while subsequent calls do not. Pending others correcting me...I fairly certain regarding my conclusions though somewhat inexperienced in doing this kind of diagnostics. David J.

Re: [PERFORM] Odd behavior with indices

2016-02-26 Thread David G. Johnston
query the planner thinks it needs 1.5 million of the rows and will have to check each of them for visibility. It decided that scanning the entire table was more efficient. The LIMIT 1 in both queries should not be necessary. The planner is smart enough to stop once it finds what it is looking for. In fact the LIMIT's presence may be a contributing factor...but I cannot say for sure. A better query seems like it would be: WITH active_sites AS ( SELECT DISTINCT site_id FROM datavalues; ) SELECT * FROM sites JOIN active_sites USING (site_id); David J.

Re: [PERFORM] Odd behavior with indices

2016-02-26 Thread David G. Johnston
633764 11994442 1849232 2014935 4563638 132955919 7 > > ​Ok...again its beyond my present experience ​but its what the planner thinks about the distribution, and not what actually is present, that matters. David J.

Re: [PERFORM] similarity and operator '%'

2016-05-30 Thread David G. Johnston
index even if it compiles (not tested): CREATE FUNCTION similarity_80(col, val) RETURNS boolean SET similarity_threshold = 0.80 LANGUAGE sql AS $$ ​SELECT ​col % val; $$; ​David J.​

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

2016-06-07 Thread David G. Johnston
> SQL ERROR[54000] > ERROR: array size exceeds the maximum allowed (1073741823) > > ​https://www.postgresql.org/about/​ ​Maximum Field Size: 1 GB​ ​It doesn't matter that the data never actually is placed into a physical table. David J.

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

2016-06-07 Thread David G. Johnston
On Tue, Jun 7, 2016 at 8:36 AM, Nicolas Paris wrote: > 2016-06-07 14:31 GMT+02:00 David G. Johnston : > >> On Tue, Jun 7, 2016 at 7:44 AM, Nicolas Paris >> wrote: >> >>> Hello, >>> >>> I run a query transforming huge tables to a json document

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

2016-06-07 Thread David G. Johnston
On Tue, Jun 7, 2016 at 8:42 AM, Nicolas Paris wrote: > > > 2016-06-07 14:39 GMT+02:00 David G. Johnston : > >> On Tue, Jun 7, 2016 at 8:36 AM, Nicolas Paris >> wrote: >> >>> 2016-06-07 14:31 GMT+02:00 David G. Johnston >> >: >>> >&

Re: [PERFORM] Performance of LIKE/NOT LIKE when used in single query

2016-06-07 Thread David G. Johnston
re col like '' and col not like '' Or a CTE (with) With likeqry as ( select where like ) Select from likeqry where not like (sorry for brevity but not at a pc) David J.

Re: [PERFORM] pg_restore seems very slow

2016-06-15 Thread David G. Johnston
ding to the docs) You need to get to a point where you are seeing feedback from the pg_restore process. Once you get it telling you what it is doing (or trying to do) then diagnosing can begin. ​David J. ​

Re: [PERFORM] Index not used

2016-06-16 Thread David G. Johnston
an additional index on "guid::text". > ​Or, better, persuade the app to label the value " ​ public.push_guid ​" since that is the column's type​...a type you haven't defined for us. If you get to add explicit casts this should be easy...but I'm not familiar with the framework you are using. David J.

[PERFORM] Capacitors, etc., in hard drives and SSD for DBMS machines...

2016-07-08 Thread Jean-David Beyer
seconds, my natural gas fueled backup generator picks up the load very quickly. Am I overlooking something? -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key:166D840A 0C610C8B Registered Machine 1935521. /( )\ Shrewsbury, New Jerseyhttp://linuxcounter.net

Re: [PERFORM] Capacitors, etc., in hard drives and SSD for DBMS machines...

2016-07-08 Thread Jean-David Beyer
On 07/08/2016 07:44 AM, vincent wrote: > > > Op 7/8/2016 om 12:23 PM schreef Jean-David Beyer: >> Why all this concern about how long a disk (or SSD) drive can stay up >> after a power failure? >> >> It seems to me that anyone interested in maintaining an

Re: [PERFORM] Performance problems with 9.2.15

2016-07-21 Thread David G. Johnston
On Thu, Jul 21, 2016 at 2:24 PM, Claudio Freire wrote: > That cross join doesn't look right. It has no join condition. ​That is that the definition of a "CROSS JOIN"... David J.

Re: [PERFORM] [HACKERS] temporary table vs array performance

2016-09-26 Thread David G. Johnston
temp table in function > > ​I have no difficulty using arrays in functions. As for "other methods" - you can use CTE (WITH) to create a truly local table - updating the catalogs by using a temp table is indeed quite expensive. WITH vals AS ( VALUES (1, 'lw'), (2, 'lw2') ) SELECT * FROM vals; David J.

Re: [PERFORM] materialized view order by and clustering

2016-11-17 Thread David G. Johnston
ed view data gets saved to the physical table thus making the table clustered on whatever order by is specified. ​David J. ​ ​

Re: [PERFORM] why we do not create indexes on master

2016-12-27 Thread David G. Johnston
en obtaining rows from the master table. If this is the case then you've gotten away from the expected usage of partitions and so need to do things that aren't in the manual to make them work. David J. David J.

Re: [PERFORM] why we do not create indexes on master

2016-12-27 Thread David G. Johnston
On Tue, Dec 27, 2016 at 10:38 AM, Valerii Valeev wrote: > Thank you David, > > I used same rationale to convince my colleague — it didn’t work :) > Sort of “pragmatic” person who does what seems working no matter what > happens tomorrow. > So I’m seeking for better under

Re: [PERFORM] optimizing immutable vs. stable function calls?

2017-01-18 Thread David G. Johnston
r - and probably examples of both as well since its not clear when it can occur. Some TLC to the docs here would be welcomed. David J.

Re: [PERFORM] optimizing immutable vs. stable function calls?

2017-01-18 Thread David G. Johnston
On Wed, Jan 18, 2017 at 4:23 PM, Tom Lane wrote: > "David G. Johnston" writes: > > ​I'm feeling a bit dense here but even after having read a number of > these > > kinds of interchanges I still can't get it to stick. I think part of the > > probl

Re: [PERFORM] Number of characters in column preventing index usage

2017-02-17 Thread David G. Johnston
; ​IIRC the only reason the first query cares to use the index is because it can perform an Index Only Scan and thus avoid touching the heap at all. If it cannot avoid touching the heap the planner is going to just use a sequential scan to retrieve the records directly from the heap and save the index lookup step. David J.

Re: [PERFORM] Number of characters in column preventing index usage

2017-02-17 Thread David G. Johnston
on the visibility map or the heap). ​https://www.postgresql.org/docs/9.6/static/indexes-index-only-scans.html​ ​David J.​

Re: [PERFORM] anti-join with small table via text/varchar cannot estimate rows correctly

2017-03-01 Thread David G. Johnston
On Wed, Mar 1, 2017 at 3:00 PM, Stefan Andreatta wrote: > plain analyze > select tmp_san_1.id > from tmp_san_1 >left join tmp_san_2 on tmp_san_1.text = tmp_san_2.text > where tmp_san_2.id is null; > > ​Does it help if you check for "tmp_san_2.text is null"? David J.

Re: [PERFORM] anti-join with small table via text/varchar cannot estimate rows correctly

2017-03-01 Thread David G. Johnston
On Wed, Mar 1, 2017 at 5:24 PM, Jeff Janes wrote: > On Wed, Mar 1, 2017 at 2:12 PM, David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Wed, Mar 1, 2017 at 3:00 PM, Stefan Andreatta > > wrote: >> >>> plain analyze >>> select t

Re: [PERFORM] Filter certain range of IP address.

2017-04-07 Thread David G. Johnston
. > > xxx 172.23.110.175 > yyy 172.23.110.178 > zzz 172.23.110.177 > aaa 172.23.110.176 > bbb 172.23.111.180 > ccc 172.23.115.26 > ​SELECT ... WHERE substring(ip_addr::text, 1, 10) = '172.23.110' David J. ​

Re: [PERFORM] Create a materialized view in PostgreSQL which can be access by all the user account

2017-04-17 Thread David G. Johnston
www.postgresql.org/docs/9.6/static/sql-grant.html David J.

Re: [PERFORM] Can postgresql plan a query using multiple CPU cores?

2017-05-22 Thread David G. Johnston
possibly partial) plans and picking the best one - flagging those plan steps that can leverage parallelism for possible execution. David J.

Re: [PERFORM] join estimate of subqueries with range conditions and constraint exclusion

2017-06-03 Thread David G. Johnston
the somewhat specialized nature of the problem, a response should be forthcoming even though its taking a bit longer than usual. David J.

Re: [PERFORM] Unlogged tables

2017-08-09 Thread David G. Johnston
hat particular unlogged table since the data files are known to be accurate. David J.

Re: [PERFORM] Hi

2017-08-25 Thread David G. Johnston
us into a single column. "CASE ... WHEN ... THEN ... ELSE ... END" is quite helpful for doing stuff like that. For now I'll just leave them as two columns. ​SELECT status, payment_status, count(*) FROM ud_document WHERE uniqueid <> '201708141701018' GROUP BY 1, 2; David J.

<    5   6   7   8   9   10