Re: [PERFORM] Slow fulltext query plan

2012-04-13 Thread Tom Lane
Benoit Delbosc writes: > On 13/04/2012 00:25, Tom Lane wrote: >> Is there a reason why you're writing the query in such a >> non-straightforward way, rather than just >> >> EXPLAIN ANALYZE SELECT hierarchy.id >> FROM hierarchy >> JOIN fulltext ON fulltext.id = hierarchy.id >> WHERE (TO_TSQUERY('w

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Claudio Freire
On Fri, Apr 13, 2012 at 2:49 PM, Steve Crawford wrote: > Well, the fact that temporary and unlogged cannot be simultaneously > specified *is* documented: > > CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT > EXISTS ] table_name > > But it would probably be worth adding

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Steve Crawford
On 04/13/2012 09:43 AM, Claudio Freire wrote: On Fri, Apr 13, 2012 at 1:36 PM, Steve Crawford wrote: If they are permanent tables used for temporary storage then making them unlogged may be beneficial. But actual temporary tables *are* unlogged and attempting to create an unlogged temporary ta

Re: [PERFORM] PostgreSQL - Help Optimizing performance - full text search on Heroku

2012-04-13 Thread Tomas Vondra
On 13.4.2012 18:14, xlash wrote: > I have a big table ~15M records called entities. I want to find top 5 > entities matching "hockey" in their name. Number of rows in not a very useful metric - if might be 15 MBs or 15 GBs, depending on the structure. We need to know at least this: select relpa

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Claudio Freire
On Fri, Apr 13, 2012 at 1:36 PM, Steve Crawford wrote: >> > If they are permanent tables used for temporary storage then making them > unlogged may be beneficial. But actual temporary tables *are* unlogged and > attempting to create an unlogged temporary table will raise an error. Interesting, ye

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Steve Crawford
On 04/13/2012 08:04 AM, Claudio Freire wrote: ...You might want to try unlogged temp tables, which more closely resemble mssql temp tables. If they are permanent tables used for temporary storage then making them unlogged may be beneficial. But actual temporary tables *are* unlogged and attemp

[PERFORM] PostgreSQL - Help Optimizing performance - full text search on Heroku

2012-04-13 Thread xlash
I have a big table ~15M records called entities. I want to find top 5 entities matching "hockey" in their name. I have a Full text index built for that, which is used : gin_ix_entity_full_text_search_name, which indexes the name. Query SELECT "entities".*, ts_rank(to_tsvector('english'

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Claudio Freire
On Wed, Apr 11, 2012 at 7:11 PM, Eyal Wilde wrote: > in a single execution postgresql may be less the twice slower than ms-sql, > but in 20 simultaneous clients, it's about 6 times worse. why is that? > > the hardware is one 4-core xeon. 8GB of ram. the database size is just a few > GB's. centos-6

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Kevin Grittner
Eyal Wilde wrote: > now, i run a test that simulates 20 simultaneous clients, asking > for "account-id" randomly. once a client get a result, it > immediately asks for another one. the test last 5 seconds. i use > a connection pool (with Tomcat web-server). the pool is > automatically increased

Re: [PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Andrew Dunstan
On 04/11/2012 06:11 PM, Eyal Wilde wrote: hi, i had a stored procedure in ms-sql server. this stored procedure gets a parameter (account-id), dose about 20 queries, fills some temporary tables, and finally, returns a few result-sets. this stored procedure converted to stored function in pos

[PERFORM] scale up (postgresql vs mssql)

2012-04-13 Thread Eyal Wilde
hi, i had a stored procedure in ms-sql server. this stored procedure gets a parameter (account-id), dose about 20 queries, fills some temporary tables, and finally, returns a few result-sets. this stored procedure converted to stored function in postgresql (9.1). the result-sets are being returned

Re: [PERFORM] Planner selects slow "Bitmap Heap Scan" when "Index Scan" is faster

2012-04-13 Thread Kim Hansen
On Tue, Apr 10, 2012 at 04:59, Jeff Janes wrote: > On Fri, Apr 6, 2012 at 3:09 PM, Kim Hansen wrote: > >> I have run the queries a few times in order to warm up the caches, the >> queries stabilise on 20ms and 180ms. > > My first curiosity is not why the estimate is too good for Bitmap > Index Sc

Re: [PERFORM] bad planning with 75% effective_cache_size

2012-04-13 Thread Istvan Endredy
Hi Kevin, thanks for the suggestion. It was my 1st task to try this after Easter. :) Sorry to say this parameter doesn't help: bad planning: set cpu_tuple_cost = '0.05'; set effective_cache_size to '6GB'; 1622ms http://explain.depesz.com/s/vuO or set cpu_tuple_cost = '0.01'; set effective_cache