Re: [GENERAL] ARRAY_LENGTH() function behavior with empty array

2016-12-02 Thread otar shavadze
Understood, and backwards compatibility also of course. Thank you On Fri, Dec 2, 2016 at 7:20 PM, Tom Lane wrote: > otar shavadze writes: > > SELECT ARRAY_LENGTH('{}'::INT[], 1) > > This returns NULL, not so "dangerous" either way, not would be more >

[GENERAL] ARRAY_LENGTH() function behavior with empty array

2016-12-02 Thread otar shavadze
SELECT ARRAY_LENGTH('{}'::INT[], 1) This returns NULL, not so "dangerous" either way, not would be more logically, if array length function will return 0 from empty array, instead of NULL ? This is just IMHO.

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-12 Thread otar shavadze
Tried OPERATOR(pg_catalog.@>) as Tom mentioned, but still, don't get fast performance when value does not existed in any array. Also "played" with many different ways, gin, gist indexes (gin with and without *gin__int_ops*) but, always, there was some situation, where search in array was

Re: [GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-10 Thread otar shavadze
@Jeff > most_common_elems. Is it empty, or is it not empty? If not empty, does > it contain the specific values you used in your queries? No, most_common_elems is not empty. it contain the specific values I used in queries. @Tom > > Hmmm ... actually, I wonder if maybe '@>' here is the co

[GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-08 Thread otar shavadze
I increased rows limit from 50 to 500, because now, difference visible much better, so query is: explain analyze *SELECT * FROM table_name WHERE my_array @> '{x}'::integer[] ORDER BY id desc LIMIT 500* with GIN index: "Limit (cost=107.83..109.08 rows=500 width=905) (actual time=978.256..978.29

[GENERAL] Gin indexes on intarray is fast when value in array does not exists, and slow, when value exists

2016-11-08 Thread otar shavadze
I have table with 500 000 rows, I have int[] column "my_array" in this table, this array column contains minimum 1 and maximum 5 different values. I have GIN index on my_array column: * "CREATE INDEX idx ON table_name USING GIN(my_array gin__int_ops)"* Then I use this query: "*SELECT * FROM tab

[GENERAL] Re: [GENERAL] Understanding “max_wal_size” and “min_wal_size” parameters default values from postgresql.conf file

2016-10-03 Thread otar shavadze
Thank you very much On Mon, Oct 3, 2016 at 11:46 PM, Tom Lane wrote: > otar shavadze writes: > > name | setting | unit-- > > max_wal_size | 64 | > > min_wal_size | 5| > > > I have 2 questions: > >

[GENERAL] Understanding “max_wal_size” and “min_wal_size” parameters default values from postgresql.conf file

2016-10-03 Thread otar shavadze
According to documentation, for "min_wal_size" and "max_wal_size" parameters default values are: For max_wal_size: The default is 1 GB For min_wal_size: The default is 80 MB Then I look this parameters from my database config:

[GENERAL]

2016-10-03 Thread otar shavadze
n6gSVg