pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSize on Disk
6+ messages / 5 participants
[nested] [flat]
* Size on Disk
@ 2003-11-25 22:21 Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Re: Size on Disk Chester Kustarz <chester@arbor.net>
0 siblings, 1 reply; 6+ messages in thread
From: Grzegorz Dostatni @ 2003-11-25 22:21 UTC (permalink / raw)
To: pgsql-admin
Hello.
I am working on a Knoppix distribution of my program.
I do have it working, but the size of the database on
disk is becoming a factor. (I copy it to ramdisk
before starting postmaster).
How can I change (minimize) the size of the db on
disk? Are there any parameters I can set? Maybe limit
the size of logs/journals?
Greg (dostatnig@yahoo.com)
__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Size on Disk
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
@ 2003-11-25 22:37 ` Chester Kustarz <chester@arbor.net>
2003-11-26 04:37 ` Re: Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-26 17:40 ` Re: Size on Disk Oli Sennhauser <oli.sennhauser@bluewin.ch>
0 siblings, 2 replies; 6+ messages in thread
From: Chester Kustarz @ 2003-11-25 22:37 UTC (permalink / raw)
To: Grzegorz Dostatni <dostatnig@yahoo.com>; +Cc: pgsql-admin
you do not mention which version of postgresql or which files are problematic,
but just guessing:
- log/checkpoint files: http://www.varlena.com/GeneralBits/Tidbits/perf.html
- index files: see "reindex" command
- table files: see FSM settings and vacuum more, or vacuum full
(contrib/pg_autovacuum is helpful here)
SELECT CASE WHEN ((SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) IS NOT NULL) THEN (SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) WHEN (class1.relname IS NOT NULL) THEN class1.relname ELSE NULL::name END AS "table", CASE WHEN (class1.relkind = 'r'::"char") THEN NULL::name ELSE class1.relname END AS "index", (class1.relpages * 8) AS "size (KBytes)" FROM pg_class class1 WHERE ((class1.relkind = 'r'::"char") OR (class1.relkind = 'i'::"char")) ORDER BY CASE WHEN ((SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) IS NOT NULL) THEN (SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) WHEN (class1.relname IS NOT NULL) THEN class1.relname ELSE NULL::name END, CASE WHEN (class1.relkind = 'r'::"char") THEN NULL::name ELSE class1.relname END, (class1.relpages * 8);
might help telling you how big things are. i have problems sometimes where
the sizes for indexes are not correct. you can also run "vacuum verbose full"
and see if it is maybe dead tuples sticking around.
On Tue, 25 Nov 2003, Grzegorz Dostatni wrote:
> I am working on a Knoppix distribution of my program.
> I do have it working, but the size of the database on
> disk is becoming a factor. (I copy it to ramdisk
> before starting postmaster).
>
> How can I change (minimize) the size of the db on
> disk? Are there any parameters I can set? Maybe limit
> the size of logs/journals?
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Size on Disk
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Re: Size on Disk Chester Kustarz <chester@arbor.net>
@ 2003-11-26 04:37 ` Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-26 05:53 ` Re: Size on Disk Tom Lane <tgl@sss.pgh.pa.us>
2003-11-26 22:58 ` Re: Size on Disk Michal Zaborowski <listy.mailowe@wp.pl>
1 sibling, 2 replies; 6+ messages in thread
From: Grzegorz Dostatni @ 2003-11-26 04:37 UTC (permalink / raw)
To: pgsql-admin
Thank you for your very quick response Chester.
I guess I should clarify something. Knoppix is a
version of linux that runs entirely in memory. I need
as smallest footprint as possible.
Currently the datase is roughly 80 Megs. About half of
the size is stored in pg_xlog directory. I managed to
figure out that those files are transaction log files?
How can I delete them safely? (after creatation the
database will pretty much be read-only - any changes
will be in memory only). Are there any other tricks I
can use to get the size down? Please keep in mind that
I work with a fairly new database - I'm always
recreating it from a dump so only the initial inserts
are in there, no changes or deletions.
Vacuuming helps a bit, but nowhere near as much as I
would hope.
Greg
Greg
__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Size on Disk
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Re: Size on Disk Chester Kustarz <chester@arbor.net>
2003-11-26 04:37 ` Re: Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
@ 2003-11-26 05:53 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 6+ messages in thread
From: Tom Lane @ 2003-11-26 05:53 UTC (permalink / raw)
To: Grzegorz Dostatni <dostatnig@yahoo.com>; +Cc: pgsql-admin
Grzegorz Dostatni <dostatnig@yahoo.com> writes:
> Currently the datase is roughly 80 Megs. About half of
> the size is stored in pg_xlog directory. I managed to
> figure out that those files are transaction log files?
> How can I delete them safely?
You can NOT. Don't even think about going there.
What you can do, if you intend only low-update-volume usage,
is reduce checkpoint_segments to reduce the number of WAL files
the system wants to keep around.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Size on Disk
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Re: Size on Disk Chester Kustarz <chester@arbor.net>
2003-11-26 04:37 ` Re: Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
@ 2003-11-26 22:58 ` Michal Zaborowski <listy.mailowe@wp.pl>
1 sibling, 0 replies; 6+ messages in thread
From: Michal Zaborowski @ 2003-11-26 22:58 UTC (permalink / raw)
To: pgsql-admin
Hello,
Try SQlite. It is small DB with SQL 92 standard - almost
implemented. If you need something fast and small it is
just for you.
BTW: it is embadded system, so concurency... is not in the
focus ;)
--
Regards
Michal Zaborowski (TeXXaS)
http://sqlite4delphi.sourceforge.net/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Size on Disk
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Re: Size on Disk Chester Kustarz <chester@arbor.net>
@ 2003-11-26 17:40 ` Oli Sennhauser <oli.sennhauser@bluewin.ch>
1 sibling, 0 replies; 6+ messages in thread
From: Oli Sennhauser @ 2003-11-26 17:40 UTC (permalink / raw)
To: Chester Kustarz <chester@arbor.net>; +Cc: Grzegorz Dostatni <dostatnig@yahoo.com>; pgsql-admin
Hello
>SELECT CASE WHEN ((SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) IS NOT NULL) THEN (SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) WHEN (class1.relname IS NOT NULL) THEN class1.relname ELSE NULL::name END AS "table", CASE WHEN (class1.relkind = 'r'::"char") THEN NULL::name ELSE class1.relname END AS "index", (class1.relpages * 8) AS "size (KBytes)" FROM pg_class class1 WHERE ((class1.relkind = 'r'::"char") OR (class1.relkind = 'i'::"char")) ORDER BY CASE WHEN ((SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) IS NOT NULL) THEN (SELECT class3.relname FROM pg_class class3, pg_index WHERE ((class1.oid = pg_index.indexrelid) AND (class3.oid = pg_index.indrelid))) WHEN (class1.relname IS NOT NULL) THEN class1.relname ELSE NULL::name END, CASE WHEN (class1.relkind = 'r'::"char") THEN NULL::name ELSE class1.relname END, (class1.relpages * 8);
>
>
I was verry interested in your querry but I did not understood it.
Therefore I rewrote it. Now it is a little simpler to read and does (in
my opinion) the same?
--
-- Amount of space per object used after vacuum
--
VACUUM;
SELECT c1.relname AS "tablename", c2.relname AS "indexname",
c2.relpages * 8 AS "size_kb", c2.relfilenode AS "filename"
FROM pg_class c1, pg_class c2, pg_index i
WHERE c1.oid = i.indrelid
AND i.indexrelid = c2.oid
UNION
SELECT relname, NULL, relpages * 8, relfilenode
FROM pg_class
WHERE relkind = 'r'
ORDER BY tablename, indexname DESC, size_kb;
Caution: This Sktipt does NOT exactly the same... but the results should
be the same
Regrards
Oli
-------------------------------------------------------
Oli Sennhauser
Database-Engineer (Oracle & PostgreSQL)
Rebenweg 6
CH - 8610 Uster / Switzerland
Phone (+41) 1 940 24 82 or Mobile (+41) 79 450 49 14
e-Mail oli.sennhauser@bluewin.ch
Website http://mypage.bluewin.ch/shinguz/PostgreSQL/
Secure (signed/encrypted) e-Mail with a Free Personal SwissSign ID: http://www.swisssign.ch
Import the SwissSign Root Certificate: http://swisssign.net/cgi-bin/trust/import
Attachments:
smime.p7s (application/x-pkcs7-signature, 3.4K) download
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2003-11-26 22:58 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-25 22:21 Size on Disk Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-25 22:37 ` Chester Kustarz <chester@arbor.net>
2003-11-26 04:37 ` Grzegorz Dostatni <dostatnig@yahoo.com>
2003-11-26 05:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-11-26 22:58 ` Michal Zaborowski <listy.mailowe@wp.pl>
2003-11-26 17:40 ` Oli Sennhauser <oli.sennhauser@bluewin.ch>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox