473,761 Members | 3,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FW: Out of swap space & memory



-----Original Message-----
From: Kevin Bartz [mailto:kb****@l oyaltymatrix.co m]
Sent: Monday, August 09, 2004 10:37 AM
To: 'm***@thegodsha lls.com'
Subject: RE: [GENERAL] Out of swap space & memory

Thanks for your reply, Mike! Theoretically, I should need only six of the
columns, but as a means of verifying integrity, I would like to de-dup using
all the columns. For instance, if there are two rows identical everywhere
but some column outside the six, I would like to know about it so I can
report back to the data provider. Maybe there's some other way to do this
kind of check?

Kevin

-----Original Message-----
From: mike g [mailto:mi**@the godshalls.com]
Sent: Friday, August 06, 2004 9:07 PM
To: Kevin Bartz
Subject: RE: [GENERAL] Out of swap space & memory

hmmmm, Can you determine which are rows are duplicates by examining one
column or must you examine all the columns?
On Fri, 2004-08-06 at 22:56, Kevin Bartz wrote:
Thanks for your reply, but how can I then solve the problem of duplicates?
Using your example, if one duplicate lives between rows 1 and 1,000,000 and another between rows 1,000,001 and 2,000,000, de-duping them individually
will result in the duplicate showing up twice.

Kevin

-----Original Message-----
From: mike g [mailto:mi**@the godshalls.com]
Sent: Friday, August 06, 2004 8:52 PM
To: Kevin Bartz
Subject: RE: [GENERAL] Out of swap space & memory

Can octanenights_ra w be altered? If so using the Sequence feature in
postgres you could autopopulate that column with a number starting at 1
on up to 36 million. Then your select queries could be select X from
octanenights_ra w where sequence_column _name > 1 and sequence_column _name
< 1000000 etc.

Mike

On Fri, 2004-08-06 at 22:40, Kevin Bartz wrote:
Well, all I'm doing right now is using psql from the command line. A bit
unintelligent, I know, but I want to make sure things will work
appropriately before I dive into the world of query editors.

Thanks for your suggestions. My data won't need to be updated regularly. In
this case, as in all others, loading each set of data is a one-shot

process,
so I don't think I'll need to worry about truncating.

I can't think of any way to break the problem into steps, since the
duplicates may well be scattered throughout the table. If I split
octanenights into octanenights1 and octanenights2 and then de-dup each
individually, I would have to first be sure that octanenights1 does not
share a duplicate with octanenights2, or that duplicate would appear in

the
UNION ALLed version. Maybe I'm missing something?

Thanks for your kind response.

Kevin

-----Original Message-----
From: mike g [mailto:mi**@the godshalls.com]
Sent: Friday, August 06, 2004 8:19 PM
To: Kevin Bartz
Cc: 'Manfred Koizar'; pg***********@p ostgresql.org
Subject: Re: [GENERAL] Out of swap space & memory

Ok,

This is a long shot but how are you executing your code? In say a
pgadminIII sql window with the below entered line after line?

If so I believe it will be treated as one transaction. With the default
settings postgres would have to keep track of everything done to be able
to rollback all the changes if it failed. I would believe that would
force it to keep track of all 56 million rows combined in memory
(probably just the oid column - I am sure the other more experienced
postgresql wizards can verify) but still that can take a lot of
resources.

If by chance you are doing it one sweep try executing it in separate
steps so the commit can be executed.

Hopefully then you won't run out of resources then.

Are you doing a drop / create say everynight to update your data? If so
perhaps using TRUNCATE octanenights might be more efficient.

If you must drop a full table perhaps a vacuum should be done
afterwards???

Mike

On Fri, 2004-08-06 at 21:32, Kevin Bartz wrote:
Mike, thanks so much for your reply. I'm sorry for not showing you my SQL.
I
didn't show it because I couldn't manage to boil it down to something
reproducible that everyone could try. But here's what it was:

drop table octanenights;
CREATE TABLE octanenights (member_id varchar(100), campaign_id

varchar(100),
catalog_type varchar(100), pushed int, delivered int, clicks int, opened int, month varchar(100), type1 int, type2 int, type3 int, type4 int,

type5 int);

copy octanenights from
'/home/kevin/octanenights/proc/uberfile/uberfile1.txt' null as '';
copy octanenights from
'/home/kevin/octanenights/proc/uberfile/uberfile2.txt' null as '';
copy octanenights from
'/home/kevin/octanenights/proc/uberfile/uberfile3.txt' null as '';

select * from octanenights limit 10;
alter table octanenights rename to octanenights_ra w;

-- de-dup the table
select member_id, campaign_id, catalog_type, pushed, delivered, clicks, opened, month, type1, type2, type3, type4, type5
into octanenights
from octanenights_ra w
group by member_id, campaign_id, catalog_type, pushed, delivered, clicks, opened, month, type1, type2, type3, type4, type5;

Let me tell you a little about octanenights. It's a file of about

36,000,000
rows, each describing an e-mail sent. Unfortunately, there are duplicate records scattered throughout the table, which I do not care about. One

might
suggest that I could've used uniq from the command line for this, but the data were not sorted originally and the duplicate records may be scattered anywhere in the table. The objective in the final line is to de-dup the table and place it into octanenights, leaving the original in
octanenights_ra w in case I ever need to refer back to it.

MS SQL Server, with as much RAM and less clock speed, de-dups the table in
about six minutes. The de-duped version has about 26,000,000 rows. The

final
line is where Postgres gobbles up all my swap and RAM and then conks
out completely.

Am I doing something wrong? Maybe there was a better way to approach

this problem? I'd be open to suggestions of any kind, since I'm still very,

very
new to the world of optimizing Postgres.

Kevin

-----Original Message-----
From: pg************* ****@postgresql .org
[mailto:pg****** ***********@pos tgresql.org] On Behalf Of Manfred Koizar Sent: Tuesday, August 03, 2004 3:04 AM
To: Kevin Bartz
Cc: pg***********@p ostgresql.org
Subject: Re: [GENERAL] Out of swap space & memory

On Mon, 2 Aug 2004 20:08:45 -0700, "Kevin Bartz"
<kb****@loyalty matrix.com> wrote:
>is there any way I can run this query?

What query? You didn't show us your SQL.

Servus
Manfred

---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your message can get through to the mailing list cleanly
---------------------------(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

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

Nov 23 '05 #1
0 2471

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

Similar topics

50
17370
by: Steve | last post by:
How do you rewrite the swap function without using a tmp variable in the swap function???? int main() { int x = 3; int y = 5; // Passing by reference
38
8458
by: JKop | last post by:
union SignedChoice{ long with_sign; unsigned long without_sign; }; int main() { SignedChoice data;
1
1630
by: Robert May | last post by:
Hi, I am trying to execute some code compiled by g++ on Linux and have found that after some time, the program allocates a huge amount of swap space (250MB on my machine which has 512MB physical) and (700MB on another server with 1GB physical RAM). I have used vmstat to trend the amount of swap and observed that the memory is not being "thrashed" and there is simply a large amount of data that has been swapped out. This still slows...
2
5096
by: news.onet.pl | last post by:
I've launched some perfomance test for some program measuring number of operations, net messages processed per second, etc. Why is my point, is the question how Java initial and maximal heap is connected with the swap space of Operating System. Those Java utilize both memory and swap space for purpose of its heap? TIA,
2
4795
by: cnprasad | last post by:
Hello, I have ntoiced something peculiar happening on our db2 instance. It serves as the backend rdbms for a java application that is hosted on websphere app server. The app server has a connection pool that can grow upto 250 connection. The database has also been configuired to handle this many connections. The db2 server has 2GB of memory.
14
4402
by: Otto Meijer | last post by:
Hi everyone, for one of my projects I need to figure out the size of the swap file(s) of a certain system. The problem is I need to do this on a host of platforms like: HP_UX, Solaris, Linux, AIX, OSF, OpenVMS and Windows. This seems much more difficult than I thought origionaly. Some platforms don't seem to have any API to query this information.
3
2699
by: Kevin Bartz | last post by:
I'm de-duping a 45-million-row table (about 4 gigs) by creating a new table with the unique rows of the first table (should be about 3 gigs). I'm on a 64-bit SuSE Linux with 2 gigs of memory and another gig of swap space. I tracked postmaster's use of memory and swap space after I run the query, and I noticed that as soon as postmaster first uses up all available memory and swap space, I get this: 2004-08-02 19:35:52 LOG: checkpoint...
1
448
by: Kevin Bartz | last post by:
-----Original Message----- From: Kevin Bartz Sent: Friday, August 06, 2004 8:41 PM To: 'mike@thegodshalls.com' Subject: RE: Out of swap space & memory Well, all I'm doing right now is using psql from the command line. A bit unintelligent, I know, but I want to make sure things will work appropriately before I dive into the world of query editors.
18
5155
by: Joe Lester | last post by:
This thread was renamed. It used to be: "shared_buffers Question". The old thread kind of died out. I'm hoping to get some more direction by rephrasing the problem, along with some extra observations I've recently made. The core of the problem is that Postgres is filling up my hard drive with swap files at the rate of around 3 to 7 GB per week (that's Gigabytes not Megabytes) . At this rate it takes roughly two months to fill up my 40...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.