Re: [PERFORM] Simple delete query is taking too long (never ends)

2015-11-11 Thread Tom Lane
Massalin Yerzhan writes: > I'm having an issue. The query never ends: > delete from bb_gamelist_league; 9 times out of 10, the answer to this type of problem is that you have some table referencing this one by a foreign key, and the referencing column is not indexed. PG doesn't require such an i

[PERFORM] Simple delete query is taking too long (never ends)

2015-11-11 Thread Massalin Yerzhan
Postgresql version 9.4.4. I'm having an issue. The query never ends: delete from bb_gamelist_league; No WHERE clause used. There are approx. 227000 rows in that table. Here is the table itself: CREATE TABLE bb_gamelist_league ( id SERIAL NOT NULL , bb_league_id INTEGER NOT NULL , day_nu

[PERFORM] Queries getting canceled inside a proc that seems to slow down randomly

2015-11-11 Thread Skarsol
We're using postgres 9.2.5. Every couple of days we'll have a query get cancelled and it is always at the start of one of our custom procedures. The query is typically part of a php loop that runs in less than a second, however when the issue occurs, that pass through the loop takes multiple second

Re: [PERFORM] Slow 3 Table Join with v bad row estimate

2015-11-11 Thread David Osborne
Sorry Igor - yes wrong plan. Here's the new one ... (running a wee bit slower this morning - still 20x faster that before however) http://explain.depesz.com/s/64YM QUERY PLAN ---