Comments (3)
Should be fixed now
from pgcompacttable.
Yeah, I observed such error yesterday. Will fix.
The query itself looks correct, but the postgresql query planner moved the cast to regclass to the join condition. Therefore, it may receive an attempt to search for a knowingly non-existent object. pg_toast_5987783_index is part of postgresql TOAST system, but should be in special schema pg_toast, not in public.
But to be sure it's the same problem, please say:
- what version of postgresql are you using
- this query gives an error? please post explain (just explain, without explain analize)
- does this query give an error if you uncomment
OFFSET 0
?
SELECT
indexname, indexdef,
pg_catalog.pg_relation_size(indexoid) as idxsize
FROM (
SELECT
indexname, indexdef,
(quote_ident(schemaname) || '.' || quote_ident(indexname))::regclass AS indexoid
FROM pg_catalog.pg_indexes
WHERE
schemaname = 'public' AND
tablename = 'user_subscriptions'/* OFFSET 0*/
) AS sq
LEFT JOIN pg_catalog.pg_constraint ON
conindid = indexoid AND contype IN ('p', 'u', 'x')
ORDER BY idxsize
from pgcompacttable.
@Melkij
Server version PostgreSQL 13.2
This query gives an error. This is the explain:
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=39.23..39.24 rows=1 width=104)
Sort Key: (pg_relation_size((((quote_ident((n.nspname)::text) || '.'::text) || quote_ident((i.relname)::text)))::regclass, 'main'::text))
-> Merge Join (cost=4.84..39.22 rows=1 width=104)
Merge Cond: (n.oid = c.relnamespace)
Join Filter: (x.indexrelid = i.oid)
-> Nested Loop Left Join (cost=0.27..1868.52 rows=453 width=136)
Join Filter: (pg_constraint.conindid = ((((quote_ident((n.nspname)::text) || '.'::text) || quote_ident((i.relname)::text)))::regclass)::oid)
-> Nested Loop (cost=0.27..83.70 rows=453 width=136)
-> Index Scan using pg_namespace_oid_index on pg_namespace n (cost=0.27..31.03 rows=1 width=68)
Filter: (nspname = 'public'::name)
-> Seq Scan on pg_class i (cost=0.00..48.14 rows=453 width=72)
Filter: (relkind = ANY ('{i,I}'::"char"[]))
-> Materialize (cost=0.00..18.43 rows=120 width=4)
-> Seq Scan on pg_constraint (cost=0.00..17.83 rows=120 width=4)
Filter: (contype = ANY ('{p,u,x}'::"char"[]))
-> Materialize (cost=4.56..18.28 rows=1 width=8)
-> Nested Loop (cost=4.56..18.28 rows=1 width=8)
-> Index Scan using pg_class_relname_nsp_index on pg_class c (cost=0.28..8.30 rows=1 width=8)
Index Cond: (relname = 'user_subscriptions'::name)
Filter: (relkind = ANY ('{r,m,p}'::"char"[]))
-> Bitmap Heap Scan on pg_index x (cost=4.29..9.96 rows=2 width=8)
Recheck Cond: (indrelid = c.oid)
-> Bitmap Index Scan on pg_index_indrelid_index (cost=0.00..4.29 rows=2 width=0)
Index Cond: (indrelid = c.oid)
With the uncommented OFFSET 0 there is no errors.
from pgcompacttable.
Related Issues (20)
- Can't compact toast tables HOT 1
- Advisory lock never cleared, and connection not closed on interrupt leads to wedged locks
- Huge deadlocks count on the last phase operations ALTER INDEX RENAME TO HOT 6
- Can not process the big table. HOT 3
- Use of uninitialized value in subtraction HOT 1
- Try to install pgstattuple
- option "--routine-vacuum" HOT 2
- Latest changes broke several databases on different servers HOT 8
- Question: How many extra space do I need when I run this tool? HOT 5
- SQL Error while compacting HOT 4
- Multiple runs for big tables HOT 3
- Question about --reindex-* parameters HOT 2
- Question about --routine-vacuum parameter HOT 2
- RDS support HOT 1
- Configurable `MAX_PAGES_PER_ROUND` HOT 1
- creating invalid index every run.
- This attempt has been initially expected to compact ~24% more space HOT 7
- Deleting comments HOT 1
- `session_replication_role` lost on reconnect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgcompacttable.