Comments (4)
I think when you make PGroonga index, system creates some Postgres objects and Groonga objects. pg_relation_size function returns Postgres objects size as 0 but you can get Groonga objects size as shown below.
- Retrieve relindex id for PGroonga index.
- Retrieve Grronga object names using
object_list
command
(I can get Groonga table object name and column object name bypgroonga_table_name()
/pgroonga_index_column_name()
function but I could not get any other object names.) - Retrieve Groonga object disk usage using
object_inspect
command (Groonga) andpgroonga_command()
function (PGroonga ) for each objects you get at 2.
postgres=# \d test;
Table "public.test"
Column | Type | Collation | Nullable | Default
--------+-----------------------+-----------+----------+---------
col1 | character varying(20) | | |
col2 | character varying(20) | | |
col3 | character varying(30) | | |
Indexes:
"test_idx" pgroonga (col1, col2)
postgres=# select i.relname, ix.indexrelid from pg_index ix inner join pg_class as i on i.oid = ix.indexrelid where i.relname = 'test_idx';
relname | indexrelid
----------+------------
test_idx | 17190
(1 row)
postgres=# select key, value->'path' from json_each(pgroonga_command('object_list')::json->1) where key like '%17190%';
key | ?column?
----------------------+-----------------------
Sources17190 | "base/5/pgrn.0000149"
Lexicon17190_0 | "base/5/pgrn.000014A"
Sources17190.col1 | "base/5/pgrn.000014B"
Lexicon17190_0.index | "base/5/pgrn.000014C"
Lexicon17190_1 | "base/5/pgrn.000014D"
Sources17190.col2 | "base/5/pgrn.000014E"
Lexicon17190_1.index | "base/5/pgrn.000014F"
(7 rows)
postgres=# select pgroonga_command('object_inspect Sources17190')::json->1->'disk_usage';
?column?
----------
12648448
(1 row)
from pgroonga.
A few month ago, I asked same question.
There are no index size command for pgroonga yet.
Alternatively, you can calculate index size with du
command.
du -sk ${PGDATA}/base/${DB_ID}/pgrn*
Maybe that command will be introduce.
ie. pgroonga.disk_usage(index_name)
from pgroonga.
@hiroyuki-sato thanks a lot for you answer, I'll do calculate this way.
from pgroonga.
Hey ๐
Is there any update on this? I feel like getting easy and accurate index sizes would be a very nice addition. Especially since (atleast in my experience) fulltext indices tend to harder to predict when it comes to their size
from pgroonga.
Related Issues (20)
- docker build error HOT 3
- PGroonga 3.1.4/3.1.5 HOT 4
- Error "function pgroonga_wal_apply() does not exist" when using pgroonga_standby_maintainer module with CREATE EXTENSION pgroonga with schema specified HOT 2
- Package for Postgres 14 on Ubuntu 20.04 HOT 6
- `@~`: accept empty text HOT 7
- `pgroonga_query_extract_keywords()`: accept empty text
- Create partial index with predicate not used when querying. HOT 3
- Can't find postgresql-14-pgdg-pgroonga-dbgsym by `apt` on Ubuntu 22.04 HOT 1
- ERROR: pgroonga: object isn't found: <Sources18956> on a Postres 16 DB HOT 34
- PGroonga 3.1.6 HOT 14
- Add out of the box logs rotating functionality in pgroonga
- Pgroonga error while inserting: ERROR: pgroonga: [insert] failed to set column value: [pat][add][Lexicon208373_0] failed to add a key: path:<base/16384/pgrn.0000124> HOT 34
- Weird similar search behavior HOT 12
- pgroonga.github.ioใฎnewsใๆดๆฐใใใฆใใชใใฃใใ`rake tag`ใๅคฑๆใใใ
- ERROR: pgroonga: [insert] failed to set column value: grn_io_lock failed HOT 27
- DB hanging again after a restart, with pgroonga_crash_safer enabled HOT 61
- PGroonga 3.1.7 HOT 1
- installing source code on macOS - 'groonga.h' file not found HOT 5
- count(*) is slow on table with groonga index HOT 3
- PGroonga 3.1.8 HOT 2
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 pgroonga.