Re: [PERFORM]

2017-06-28 Thread Yevhenii Kurtov
Hello folks, Thank you very much for analysis and suggested - there is a lot to learn here. I just tried UNION queries and got following error: ERROR: FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT I made a table dump for anyone who wants to give it a spin https://app.box.com/s/464b12gl

Re: [PERFORM] Performance of information_schema with many schemata and tables

2017-06-28 Thread Ulf Lohbrügge
2017-06-28 10:43 GMT+02:00 Pritam Baral : > > > On Wednesday 28 June 2017 02:00 PM, Ulf Lohbrügge wrote: > > Nope, I didn't try that yet. But I don't have the impression that > reindexing the indexes in information_schema will help. The table > information_schema.tables consists of the following i

Re: [PERFORM] Efficiently merging and sorting collections of sorted rows

2017-06-28 Thread Merlin Moncure
On Fri, Jun 23, 2017 at 6:33 PM, Tom Lane wrote: > Clint Miller writes: >> That's a good plan because it's not doing a quick sort. Instead, it's just >> reading the sort order off of the index, which is exactly what I want. (I >> had to disable enable_sort because I didn't have enough rows of tes

Re: [PERFORM]

2017-06-28 Thread Brad DeJong
On 2017-06-28, Pavel Stehule wrote ... > On 2017-06-28, Yevhenii Kurtov wrote ... >> On 2017-06-28, Pavel Stehule wrote ... >>> On 2017-06-28, Yevhenii Kurtov wrote ... We have a query that is run almost each second and it's very important to squeeze every other ms out of it. The query

Re: [PERFORM]

2017-06-28 Thread Gerardo Herzig
- Mensaje original - > De: "Yevhenii Kurtov" > Para: pgsql-performance@postgresql.org > Enviados: Miércoles, 28 de Junio 2017 3:47:44 > Asunto: [PERFORM] > > Hello, > > We have a query that is run almost each second and it's very important to > squeeze every other ms out of it. The que

Re: [PERFORM] Performance of information_schema with many schemata and tables

2017-06-28 Thread Ulf Lohbrügge
Nope, I didn't try that yet. But I don't have the impression that reindexing the indexes in information_schema will help. The table information_schema.tables consists of the following indexes: "pg_class_oid_index" UNIQUE, btree (oid) "pg_class_relname_nsp_index" UNIQUE, btree (relname, rel

Re: [PERFORM]

2017-06-28 Thread Pavel Stehule
2017-06-28 9:28 GMT+02:00 Yevhenii Kurtov : > Hello Pavel, > > Can you please give a tip how to rewrite the query with UNION clause? I > didn't use it at all before actually and afraid that will not get it > properly from the first time :) > SELECT c0."id" FROM "campaign_jobs" AS c0 WHERE (((c0."

Re: [PERFORM]

2017-06-28 Thread Yevhenii Kurtov
Hello Pavel, Can you please give a tip how to rewrite the query with UNION clause? I didn't use it at all before actually and afraid that will not get it properly from the first time :) On Wed, Jun 28, 2017 at 2:12 PM, Pavel Stehule wrote: > > > 2017-06-28 8:47 GMT+02:00 Yevhenii Kurtov : > >>

Re: [PERFORM]

2017-06-28 Thread Pavel Stehule
2017-06-28 8:47 GMT+02:00 Yevhenii Kurtov : > Hello, > > We have a query that is run almost each second and it's very important to > squeeze every other ms out of it. The query is: > > SELECT c0."id" FROM "campaign_jobs" AS c0 > WHERE (((c0."status" = $1) AND NOT (c0."id" = ANY($2 > OR ((c0."s