Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > about compressing or table size, purge

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-03, 04:52
marin marin is offline
Registered User
 
Join Date: May 2003
Location: ROMANIA
Posts: 3
about compressing or table size, purge

I have a problem with Informix. I have a large table (about 100.000 rows). I need to delete about 70.000 from the table running a sql query like
delete from mytable where idcount<70000

It deletes but ... the records are still there. Is there a command like purge or something? Maybe a compress command or something that could help me?
Thanks
Reply With Quote
  #2 (permalink)  
Old 05-22-03, 12:55
eherber eherber is offline
Registered User
 
Join Date: Aug 2002
Location: Bonn/Germany
Posts: 152
alter index <idxname> to cluster;

OR

alter fragment on table <table_name> init in <new_dbspace>;

However make sure that you have enough logical-log
space or turn the database logging off for this task
if possible.
__________________

Best regards

Eric
--
IT-Consulting Herber
WWW: http://www.herber-consulting.de
Email: eric@herber-consulting.de

***********************************************
Download the IFMX Database-Monitor for free at:
http://www.herber-consulting.de/BusyBee
***********************************************
Reply With Quote
  #3 (permalink)  
Old 05-28-03, 01:07
dananio dananio is offline
Registered User
 
Join Date: Mar 2002
Posts: 112
Re

Please check it out , your transaction isn't rollback
Reply With Quote
  #4 (permalink)  
Old 05-28-03, 04:16
marin marin is offline
Registered User
 
Join Date: May 2003
Location: ROMANIA
Posts: 3
about

I think that there is no rollback. I have read a lot from the internet and I have found that the only way to really purge the deleted records are to export the current info, drop the table and restore .
Reply With Quote
  #5 (permalink)  
Old 05-28-03, 04:38
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
This is impossible,

if you delete rows out of an infrmix database they are deleted.

why don't you try it this way:

begin work;
delete from table where count < 70000;
commit;

You could always first check how many rows and what rows will be deleted. Use
select count(*) from table where count < 70000

Unlike Oracle, Informix will fill up this deleted space with the next inserts in your table. No space is wasted.
No online purge is available in informix. There is always an exclusive lock on the table when you do a reorganization.
ALTER FRAGMENT is the best and easiest way.
__________________
rws
Reply With Quote
  #6 (permalink)  
Old 05-28-03, 04:48
marin marin is offline
Registered User
 
Join Date: May 2003
Location: ROMANIA
Posts: 3
continue

Because I'm new to informix I cannot say that it isn't true. Can you write a complete command for alter fragment.

All that I do is

delete from events where id<50.000
Reply With Quote
  #7 (permalink)  
Old 05-28-03, 06:53
Roelwe Roelwe is offline
Registered User
 
Join Date: Aug 2002
Location: Belgium
Posts: 534
Are you sure you put a dot?
50.000 or 50000?

Makes a big difference...

You can find the complete SQL syntax at the syntax guide. Go to
http://www.ibm.com/software/data/informix
library
Documentation on Informix Products.
Informix Dynamic Server (Your Version).

An example would be, if your table is not fragmented...

ALTER FRAGMENT ON events INIT IN dbspace;

where dbspace is the location where you want to put the table.
If your feeling is that it's a big table, you could fragment it over different dbspaces. 100000 rows is not so big though. Depends a bit on the size of the row.
__________________
rws
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On