Re: [PERFORM] Query performance

2015-01-30 Thread Pavel Stehule
2015-01-31 2:40 GMT+01:00 Jim Nasby : > On 1/25/15 2:03 AM, Pavel Stehule wrote: > >> It might not always be an integer, just happens to be so here. >> Should I try text instead? I don't have to have the case-insensitive >> matching. >> >> >> text can be better >> > > bytea would be ev

Re: [PERFORM] Performance of Postgresql Foreign Data Wrapper

2015-01-30 Thread Jim Nasby
On 1/14/15 10:48 AM, Cassiano, Marco wrote: Both query were issued repeatedly to get rid of disk access and database connection overhead time. Activating duration and statement logging on the remote server I can see that the query issued through the fdw from the LOCAL SERVER is actually perform

Re: [PERFORM] Autocompletion with full text search

2015-01-30 Thread Jim Nasby
On 1/15/15 6:41 PM, Ivan Schneider wrote: We implemented an autocompletion feature (case and accent insensitive) using PostgreSQL full text search. The query fetches patient ids matching the full text query that belong to a given patient base (rows contain a pg_array with patient_base_ids). Our

Re: [PERFORM] Query performance

2015-01-30 Thread Jim Nasby
On 1/25/15 2:03 AM, Pavel Stehule wrote: It might not always be an integer, just happens to be so here. Should I try text instead? I don't have to have the case-insensitive matching. text can be better bytea would be even better yet, because that will always be a straight binary

Re: [PERFORM] working around JSONB's lack of stats?

2015-01-30 Thread Jim Nasby
On 1/30/15 2:26 PM, Josh Berkus wrote: On 01/28/2015 03:50 PM, Peter Geoghegan wrote: On Wed, Jan 28, 2015 at 3:42 PM, Josh Berkus wrote: jsonb_col @> '[ "key1" ]' or jsonb_col ? 'key1' if in MCE, assign % from MCE otherwise assign 1% of non-MCE % jsonb_col @> '{ "key1": "va

Re: [PERFORM] why pg_class.relfrozenxid needs to be updated for frozen tables (where all rows have xmin=2)?

2015-01-30 Thread Jim Nasby
On 1/30/15 5:44 PM, Slava Mudry wrote: Hi, I have to deal with badly written system which regularly suffers from transaction wraparound issue. This issue is happenning every 10-14 days and forces me to take system offline and vacuum in single-user mode. Main causes for this are (afaik): 1) heavy

[PERFORM] why pg_class.relfrozenxid needs to be updated for frozen tables (where all rows have xmin=2)?

2015-01-30 Thread Slava Mudry
Hi, I have to deal with badly written system which regularly suffers from transaction wraparound issue. This issue is happenning every 10-14 days and forces me to take system offline and vacuum in single-user mode. Main causes for this are (afaik): 1) heavy transaction traffic + 100+GB of stale tab

Re: [PERFORM] working around JSONB's lack of stats?

2015-01-30 Thread Josh Berkus
On 01/28/2015 03:50 PM, Peter Geoghegan wrote: > On Wed, Jan 28, 2015 at 3:42 PM, Josh Berkus wrote: >> jsonb_col @> '[ "key1" ]' >> or jsonb_col ? 'key1' >> if in MCE, assign % from MCE >> otherwise assign 1% of non-MCE % >> >> jsonb_col @> '{ "key1": "value1" }' >> if in