473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ERROR: REINDEX DATABASE: Can be executed only on the currently open database.

I suspect there is something wrong because it takes 73s to delete a single line
from a table whith 140 lines. So I tried to reindex the database:

bash-2.05b$ postgres -P -O -D /var/lib/pgsql/data KakaoStats
LOG: database system was shut down at 2004-04-11 19:55:10 BRT
LOG: checkpoint record is at 7/9505D650
LOG: redo record is at 7/9505D650; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 24438; next oid: 1850892
LOG: database system is ready

POSTGRES backend interactive interface
1.307.2.1 2003/01/01 21:57:18

backend> reindex database KakaoStats
ERROR: REINDEX DATABASE: Can be executed only on the currently open database.
backend>
__________________________________________________ ____________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
5 6943
=?iso-8859-1?q?Clodoaldo=20Pinto=20Neto?= <cl*************@yahoo.com.br> writes:
I suspect there is something wrong because it takes 73s to delete a single line
from a table whith 140 lines. So I tried to reindex the database:
It's fairly unlikely that that is the solution you need. How often do
you vacuum this table? Does it participate in any foreign keys, or do
you have any user-defined triggers on it?
backend> reindex database KakaoStats
ERROR: REINDEX DATABASE: Can be executed only on the currently open database.


Double quotes would help here.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
--- Tom Lane <tg*@sss.pgh.pa.us> escreveu: >
It's fairly unlikely that that is the solution you need. How often do
you vacuum this table?
A vacuum is executed every tree hours to the whole database after it is updated
with more than 300.000 inserts and deletes.
Does it participate in any foreign keys, or do
you have any user-defined triggers on it?


It participates in two foreign keys. No ud triggers on it.
backend> reindex database KakaoStats
ERROR: REINDEX DATABASE: Can be executed only on the currently open

database.

Double quotes would help here.

I will try it.
__________________________________________________ ____________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
=?iso-8859-1?q?Clodoaldo=20Pinto=20Neto?= <cl*************@yahoo.com.br> writes:
--- Tom Lane <tg*@sss.pgh.pa.us> escreveu: >
It's fairly unlikely that that is the solution you need. How often do
you vacuum this table?
A vacuum is executed every tree hours to the whole database after it is updated
with more than 300.000 inserts and deletes.


And is that *sufficient*? Is the table size staying constant, or
growing? It seems likely to me that you have an increasing amount
of wasted space in the table, and that the real solution requires
more frequent vacuums and/or increased FSM settings.

What does "vacuum verbose" have to say about the table?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4
--- Tom Lane <tg*@sss.pgh.pa.us> escreveu: >
--- Tom Lane <tg*@sss.pgh.pa.us> escreveu: >
It's fairly unlikely that that is the solution you need. How often do
you vacuum this table?
A vacuum is executed every tree hours to the whole database after it is

updated
with more than 300.000 inserts and deletes.


And is that *sufficient*? Is the table size staying constant, or
growing? It seems likely to me that you have an increasing amount
of wasted space in the table, and that the real solution requires
more frequent vacuums and/or increased FSM settings.


The tables are growing slowly.
What does "vacuum verbose" have to say about the table?


The total pages for the table usuarios is 200,000+. The default for
max_fsm_pages is 20,000, isn't it (7.3.4)? So I should set it to say, 250,000?

KakaoStats=# vacuum verbose datas;
INFO: --Relation public.datas--
INFO: Index data_ndx: Pages 2; Tuples 109: Deleted 2.
CPU 0.00s/0.00u sec elapsed 0.01 sec.
INFO: Index datas_data_key: Pages 2; Tuples 109: Deleted 2.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: Removed 2 tuples in 1 pages.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: Pages 1: Changed 1, Empty 0; Tup 109: Vac 2, Keep 0, UnUsed 16.
Total CPU 0.00s/0.00u sec elapsed 0.03 sec.
VACUUM

KakaoStats=# vacuum verbose times;
INFO: --Relation public.times--
INFO: Index times_pkey: Pages 2936; Tuples 1021116: Deleted 18498.
CPU 0.38s/0.68u sec elapsed 5.95 sec.
INFO: Removed 18498 tuples in 101 pages.
CPU 0.00s/0.02u sec elapsed 0.04 sec.
INFO: Pages 5717: Changed 101, Empty 0; Tup 1021116: Vac 18498, Keep 0, UnUsed
17998.
Total CPU 0.66s/0.77u sec elapsed 6.36 sec.
VACUUM

KakaoStats=# vacuum verbose usuarios;
INFO: --Relation public.usuarios--
INFO: Index usuarios_data: Pages 88896; Tuples 33277223: Deleted 607555.
CPU 10.68s/16.75u sec elapsed 302.68 sec.
INFO: Removed 607555 tuples in 3575 pages.
CPU 0.41s/0.54u sec elapsed 3.08 sec.
INFO: Pages 202794: Changed 3575, Empty 0; Tup 33277223: Vac 607555, Keep 0,
UnUsed 590054.
Total CPU 23.01s/19.71u sec elapsed 383.32 sec.
VACUUM

shared_buffers = 3000 # min max_connections*2 or 16, 8KB each
#max_fsm_relations = 1000 # min 10, fsm is free space map, ~40 bytes
#max_fsm_pages = 10000 # min 1000, fsm is free space map, ~6 bytes
#max_locks_per_transaction = 64 # min 10
#wal_buffers = 8 # min 4, typically 8KB each

Regards,
Clodoaldo

__________________________________________________ ____________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #5
=?iso-8859-1?q?Clodoaldo=20Pinto=20Neto?= <cl*************@yahoo.com.br> writes:
[ reasonable-looking VACUUM VERBOSE stats ]


AFAICS those are reasonable-size indexes; REINDEX is unlikely to make
them much smaller. Since you say you do have foreign keys involved,
that is probably where the problem is. Check that the data types of
referencing and referenced columns match, and that you have indexes
on the referencing columns. PG only forces you to have indexes on
the referenced columns, but if you lack the others then deletes require
seqscans through the referencing tables ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Grahammer | last post by:
For some reason I am getting an error when trying to open a recordset on an Access database on my Win2K3 machine from my INDEX.ASP page, but the same code accesses the database fine when coming...
1
by: Thomas Bamesberger | last post by:
Hi, yes i know, this question has already been asked and i found it in the archives, but i didnt find an answer for this problem, so maybe one of you can help me? My PostgreSQL Database has...
2
by: G.W. Lucas | last post by:
I apologize if this is a RTFM question, but I have not been able to find a definitive answer elsewhere. Does a "REINDEX TABLE" lock the table while it is working? Can applications write data to...
5
by: Edmund Dengler | last post by:
Howdy all! Quick question regarding REINDEX. I have a large table with 1077455 rows. I have an index on the table with a WHERE clause that limits the rows to around 10-50. When I REINDEX this...
7
by: Lau Lei Cheong | last post by:
Hello, Actually I think I should have had asked it long before, but somehow I haven't. Here's the scenerio: Say we have a few pages in an ASP.NET project, each of them needs to connect to...
3
by: Raziq Shekha | last post by:
Hi Folks, SQL Server 2000 SP3 on Windows 2000. I have a database on which I ran the command : dbcc dbreindex ('tablename') go for all tables in the database. Then I compared the dbcc...
29
by: =?Utf-8?B?SGVybWF3aWg=?= | last post by:
Hello, Please anybody help me. I have only a little experience with web development. I created simple project using ASP NET 2.0 (VS 2005) It works fine on local computer. When I tried to run...
0
by: RCapps | last post by:
When running the below SQL Query I keep getting the following error: Server: Msg 4924, Level 16, State 1, Line 1 ALTER TABLE DROP COLUMN failed because column 'ContractDef' does not exist in table...
11
by: fniles | last post by:
One of our application uses VB6 and Access97 database. Another application uses VB.NET 2005. This morning for about 15 seconds when the application tries to read either a query or a table from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.