forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5b56264
committed
Teach ANALYZE to clear pg_class.relhassubclass when appropriate.
In the past, relhassubclass always remained true if a relation had ever hadchild relations, even if the last subclass was long gone. While this hadonly marginal performance implications in most cases, it was annoying, andI'm now considering some planner changes that would raise the cost of afalse positive. It was previously impractical to fix this because of racecondition concerns. However, given the recent change that made tablecmds.ctake ShareExclusiveLock on relations that are gaining a child (commitfbcf4b9), we can now allow ANALYZE toclear the flag when it's no longer relevant. There is no additionallocking cost to do so, since ANALYZE takes ShareExclusiveLock anyway.1 parent2f72d5d commit5b56264
File tree
4 files changed
+32
-17
lines changed- src
- backend
- catalog
- commands
- include/commands
4 files changed
+32
-17
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
232 |
| - | |
| 231 | + | |
| 232 | + | |
233 | 233 |
| |
234 | 234 |
| |
235 |
| - | |
| 235 | + | |
| 236 | + | |
236 | 237 |
| |
237 | 238 |
| |
238 | 239 |
| |
|
Lines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
1408 | 1409 |
| |
1409 | 1410 |
| |
1410 | 1411 |
| |
1411 |
| - | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
1412 | 1415 |
| |
1413 | 1416 |
| |
1414 | 1417 |
| |
1415 |
| - | |
1416 |
| - | |
1417 |
| - | |
1418 |
| - | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1419 | 1421 |
| |
1420 | 1422 |
| |
1421 | 1423 |
| |
|
Lines changed: 19 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
253 | 253 |
| |
254 | 254 |
| |
255 | 255 |
| |
256 |
| - | |
257 | 256 |
| |
258 | 257 |
| |
259 | 258 |
| |
| |||
1359 | 1358 |
| |
1360 | 1359 |
| |
1361 | 1360 |
| |
1362 |
| - | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1363 | 1365 |
| |
1364 | 1366 |
| |
1365 | 1367 |
| |
| |||
1958 | 1960 |
| |
1959 | 1961 |
| |
1960 | 1962 |
| |
1961 |
| - | |
| 1963 | + | |
1962 | 1964 |
| |
1963 | 1965 |
| |
1964 | 1966 |
| |
| |||
1985 | 1987 |
| |
1986 | 1988 |
| |
1987 | 1989 |
| |
| 1990 | + | |
1988 | 1991 |
| |
1989 |
| - | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
1990 | 2003 |
| |
1991 |
| - | |
1992 |
| - | |
| 2004 | + | |
| 2005 | + | |
1993 | 2006 |
| |
1994 | 2007 |
| |
1995 | 2008 |
| |
1996 | 2009 |
| |
1997 | 2010 |
| |
1998 | 2011 |
| |
1999 | 2012 |
| |
2000 |
| - | |
2001 |
| - | |
2002 |
| - | |
2003 | 2013 |
| |
2004 | 2014 |
| |
2005 | 2015 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
| 47 | + | |
46 | 48 |
| |
47 | 49 |
| |
48 | 50 |
| |
|
0 commit comments
Comments
(0)