From ingridm@qoslabs.com Wed Aug 13 14:04:37 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0FD85D1C4C8 for ; Wed, 13 Aug 2003 14:04:37 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 16330-10 for ; Wed, 13 Aug 2003 11:03:04 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id AC7F9D1C4B8 for ; Wed, 13 Aug 2003 11:04:21 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK007NA9RARH@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 10:04:22 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081310042003352 for ; Wed, 13 Aug 2003 10:04:20 -0400 Date: Wed, 13 Aug 2003 09:03:31 -0500 From: ingrid martinez Subject: How can I Improve performance in Solaris? To: pgsql-performance@postgresql.org Message-id: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: multipart/alternative; boundary="Boundary_(ID_YgqVKM6e27aF0YmARNpKMw)" X-Priority: 3 X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70 X-Spam-Level: X-Archive-Number: 200308/233 X-Sequence-Number: 3050 This is a multi-part message in MIME format. --Boundary_(ID_YgqVKM6e27aF0YmARNpKMw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT I want to know, how can I improve the performance of postgres, I have a java class thar inserts register every 30 min but is very slow. The process of postgres consume the 78% of CPU. I have in /etc/system set shmsys:shminfo_shmmax=0x50000000 set shmsys:shminfo_shmmni=0x100 set shmsys:shminfo_shmseg=0x10 Thanks Ingrid --Boundary_(ID_YgqVKM6e27aF0YmARNpKMw) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT
I want to know, how can I improve the performance of postgres, I have a java class thar inserts register every 30 min but is very slow.
The process of postgres consume the 78% of CPU.
 
I have in /etc/system
 

set shmsys:shminfo_shmmax=0x50000000
set shmsys:shminfo_shmmni=0x100
set shmsys:shminfo_shmseg=0x10

 

Thanks

Ingrid

--Boundary_(ID_YgqVKM6e27aF0YmARNpKMw)-- From andrew@libertyrms.info Wed Aug 13 14:33:05 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3BD9ED1C4B8 for ; Wed, 13 Aug 2003 14:33:05 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 25564-08 for ; Wed, 13 Aug 2003 11:31:33 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 86029D1B56B for ; Wed, 13 Aug 2003 11:32:53 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19mwgM-0007Xp-00 for ; Wed, 13 Aug 2003 10:32:58 -0400 Received: by dba2 (Postfix, from userid 1019) id 666DACF50; Wed, 13 Aug 2003 10:32:58 -0400 (EDT) Date: Wed, 13 Aug 2003 10:32:58 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: How can I Improve performance in Solaris? Message-ID: <20030813143258.GC15743@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/234 X-Sequence-Number: 3051 On Wed, Aug 13, 2003 at 09:03:31AM -0500, ingrid martinez wrote: > I want to know, how can I improve the performance of postgres, I > have a java class thar inserts register every 30 min but is very > slow. What does the query do? How is postgres configured? A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From ingridm@qoslabs.com Wed Aug 13 15:18:50 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0FFB4D1B53A for ; Wed, 13 Aug 2003 15:18:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 33323-01 for ; Wed, 13 Aug 2003 12:17:11 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id A976BD1C4BF for ; Wed, 13 Aug 2003 12:18:37 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK0074ZD70RH@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 11:18:37 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081311183519840 ; Wed, 13 Aug 2003 11:18:35 -0400 Date: Wed, 13 Aug 2003 10:17:45 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/237 X-Sequence-Number: 3054 The query that execute is only inserts, I use a batch of 300 and then do commit. insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) and postgresql.conf looks like this # # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form # # name = value # # (The `=' is optional.) White space is collapsed, comments are # introduced by `#' anywhere on a line. The complete list of option # names and allowed values can be found in the PostgreSQL # documentation. The commented-out settings shown in this file # represent the default values. # Any option can also be given as a command line switch to the # postmaster, e.g., 'postmaster -c log_connections=on'. Some options # can be changed at run-time with the 'SET' SQL command. #======================================================================== # # Connection Parameters # #tcpip_socket = false #ssl = false #max_connections = 32 #port = 5432 #hostname_lookup = false #show_source_port = false #unix_socket_directory = '' #unix_socket_group = '' #unix_socket_permissions = 0777 #virtual_host = '' #krb_server_keyfile = '' # # Shared Memory Size # #shared_buffers = 64 # 2*max_connections, min 16 #max_fsm_relations = 100 # min 10, fsm is free space map #max_fsm_pages = 10000 # min 1000, fsm is free space map #max_locks_per_transaction = 64 # min 10 #wal_buffers = 8 # min 4 # # Non-shared Memory Sizes # #sort_mem = 512 # min 32 #vacuum_mem = 8192 # min 1024 # # Write-ahead log (WAL) # #wal_files = 0 # range 0-64 #wal_sync_method = fsync # the default varies across platforms: # # fsync, fdatasync, open_sync, or open_datasync #wal_debug = 0 # range 0-16 #commit_delay = 0 # range 0-100000 #commit_siblings = 5 # range 1-1000 #checkpoint_segments = 3 # in logfile segments (16MB each), min 1 #checkpoint_timeout = 300 # in seconds, range 30-3600 #fsync = true # # Optimizer Parameters # #enable_seqscan = true #enable_indexscan = true #enable_tidscan = true #enable_sort = true #enable_nestloop = true #enable_mergejoin = true #enable_hashjoin = true #ksqo = false #effective_cache_size = 1000 # default in 8k pages #random_page_cost = 4 #cpu_tuple_cost = 0.01 #cpu_index_tuple_cost = 0.001 #cpu_operator_cost = 0.0025 # # GEQO Optimizer Parameters # #geqo = true #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_threshold = 11 #geqo_pool_size = 0 # default based on #tables in query, range 128-1024 #geqo_effort = 1 #geqo_generations = 0 #geqo_random_seed = -1 # auto-compute seed # # Debug display # #silent_mode = false #log_connections = false #log_timestamp = false #log_pid = false #debug_level = 0 # range 0-16 #debug_print_query = false #debug_print_parse = false #debug_print_rewritten = false #debug_print_plan = false #debug_pretty_print = false # requires USE_ASSERT_CHECKING #debug_assertions = true # # Syslog # # requires ENABLE_SYSLOG #syslog = 0 # range 0-2 #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' # # Statistics # #show_parser_stats = false #show_planner_stats = false #show_executor_stats = false #show_query_stats = false # requires BTREE_BUILD_STATS #show_btree_build_stats = false # # Access statistics collection # #stats_start_collector = true #stats_reset_on_server_start = true #stats_command_string = false #stats_row_level = false #stats_block_level = false # # Lock Tracing # #trace_notify = false # requires LOCK_DEBUG #trace_locks = false #trace_userlocks = false #trace_lwlocks = false #debug_deadlocks = false #trace_lock_oidmin = 16384 #trace_lock_table = 0 # # Misc # #dynamic_library_path = '$libdir' #australian_timezones = false #authentication_timeout = 60 # min 1, max 600 #deadlock_timeout = 1000 #default_transaction_isolation = 'read committed' #max_expr_depth = 10000 # min 10 #max_files_per_process = 1000 # min 25 #password_encryption = false #sql_inheritance = true #transform_null_equals = false ----- Original Message ----- From: "Andrew Sullivan" To: Sent: Wednesday, August 13, 2003 9:32 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, Aug 13, 2003 at 09:03:31AM -0500, ingrid martinez wrote: > > I want to know, how can I improve the performance of postgres, I > > have a java class thar inserts register every 30 min but is very > > slow. > > What does the query do? How is postgres configured? > > A > > -- > ---- > Andrew Sullivan 204-4141 Yonge Street > Liberty RMS Toronto, Ontario Canada > M2P 2A8 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org From rbt@rbt.ca Wed Aug 13 15:50:00 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 93DB2D1C4C7 for ; Wed, 13 Aug 2003 15:50:00 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 31224-07 for ; Wed, 13 Aug 2003 12:48:23 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 8E5D9D1C4BF for ; Wed, 13 Aug 2003 12:49:49 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 71CDA10259; Wed, 13 Aug 2003 11:42:15 -0400 (EDT) Received: from [10.0.2.6] (unknown [10.0.2.6]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 5F8D610248; Wed, 13 Aug 2003 11:42:13 -0400 (EDT) Subject: Re: How can I Improve performance in Solaris? From: Rod Taylor To: ingrid martinez Cc: Andrew Sullivan , Postgresql Performance In-Reply-To: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-W/s6Lp6iH1BGB0Ii6YHL" Message-Id: <1060789790.11688.21.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 13 Aug 2003 11:49:51 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/240 X-Sequence-Number: 3057 --=-W/s6Lp6iH1BGB0Ii6YHL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2003-08-13 at 11:17, ingrid martinez wrote:=20 > The query that execute is only inserts, I use a batch of 300 and then do > commit. >=20 > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Any foreign keys on this table? Triggers or Rules? What kind of hardware do you have? Anything else running on it? Could you provide the header information from top? Off the cuff, modify your postgresql.conf for the below and restart PostgreSQL. shared_buffers =3D 1000 # 2*max_connections, min 16 effective_cache_size =3D 4000 # default in 8k pages --=-W/s6Lp6iH1BGB0Ii6YHL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/Ol4e6DETLow6vwwRAncYAJ4kl0nTEIuJUfboPG4JWe3VYWrIFACeMeZp Fc0qqCKlo87W51j1/t04zzE= =vY3Y -----END PGP SIGNATURE----- --=-W/s6Lp6iH1BGB0Ii6YHL-- From andrew@libertyrms.info Wed Aug 13 16:17:14 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 15912D1C4D0 for ; Wed, 13 Aug 2003 16:17:14 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37951-02 for ; Wed, 13 Aug 2003 13:15:36 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id DE006D1C4BF for ; Wed, 13 Aug 2003 13:17:01 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19myJ4-0000m8-00 for ; Wed, 13 Aug 2003 12:17:02 -0400 Received: by dba2 (Postfix, from userid 1019) id 95586CF52; Wed, 13 Aug 2003 12:17:01 -0400 (EDT) Date: Wed, 13 Aug 2003 12:17:01 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: How can I Improve performance in Solaris? Message-ID: <20030813161701.GA599@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/241 X-Sequence-Number: 3058 On Wed, Aug 13, 2003 at 10:17:45AM -0500, ingrid martinez wrote: > The query that execute is only inserts, I use a batch of 300 and then do > commit. > > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Are there any foreign keys, &c? > > and > > postgresql.conf looks like this [ . . .] The configuration is the default. You'll certainly want to increase the shared memory and fiddle with some of the other usual pieces. There is some discussion of the config file at . Unless the INSERTs are causing SELECTs, though, I can't see what exactly might be causing you so much difficulty. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110 From ingridm@qoslabs.com Wed Aug 13 16:21:43 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 469FBD1C4C7 for ; Wed, 13 Aug 2003 16:21:43 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 38206-02 for ; Wed, 13 Aug 2003 13:20:04 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id 89600D1C4BF for ; Wed, 13 Aug 2003 13:21:30 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK00EBEG3URF@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 12:21:30 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081312212820948 ; Wed, 13 Aug 2003 12:21:29 -0400 Date: Wed, 13 Aug 2003 11:20:39 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <00a001c361b6$d668a430$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <001f01c361a3$ae2c7ae0$8e64a8c0@ingridmartinez> <20030813143258.GC15743@libertyrms.info> <003e01c361ae$0cf914c0$8e64a8c0@ingridmartinez> <20030813161701.GA599@libertyrms.info> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/242 X-Sequence-Number: 3059 Floes table looks like this Table "flows" Column | Type | Modifiers ----------------------+--------------------------+----------- flidload | bigint | not null firsttime | bigint | fldestpeeraddress | character varying(30) | fldesttransaddress | bigint | fldesttranstype | smallint | fldfromoctets | bigint | fldscodepoint | smallint | fldtooctets | bigint | flfrompdus | bigint | flid | text | flidrule | bigint | flsourcepeeraddress | character varying(30) | flsourcetransaddress | bigint | flsourcetranstype | smallint | fltime | timestamp with time zone | fltopdus | bigint | lasttime | bigint | sourceinterface | smallint | destinterface | smallint | sourceasn | smallint | destasn | smallint | Primary key: flows_pkey insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) postgresql.conf looks like this # # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form # # name = value # # (The `=' is optional.) White space is collapsed, comments are # introduced by `#' anywhere on a line. The complete list of option # names and allowed values can be found in the PostgreSQL # documentation. The commented-out settings shown in this file # represent the default values. # Any option can also be given as a command line switch to the # postmaster, e.g., 'postmaster -c log_connections=on'. Some options # can be changed at run-time with the 'SET' SQL command. #======================================================================== # # Connection Parameters # #tcpip_socket = false #ssl = false #max_connections = 32 #port = 5432 #hostname_lookup = false #show_source_port = false #unix_socket_directory = '' #unix_socket_group = '' #unix_socket_permissions = 0777 #virtual_host = '' #krb_server_keyfile = '' # # Shared Memory Size # #shared_buffers = 64 # 2*max_connections, min 16 #max_fsm_relations = 100 # min 10, fsm is free space map #max_fsm_pages = 10000 # min 1000, fsm is free space map #max_locks_per_transaction = 64 # min 10 #wal_buffers = 8 # min 4 # # Non-shared Memory Sizes # #sort_mem = 512 # min 32 #vacuum_mem = 8192 # min 1024 # # Write-ahead log (WAL) # #wal_files = 0 # range 0-64 #wal_sync_method = fsync # the default varies across platforms: # # fsync, fdatasync, open_sync, or open_datasync #wal_debug = 0 # range 0-16 #commit_delay = 0 # range 0-100000 #commit_siblings = 5 # range 1-1000 #checkpoint_segments = 3 # in logfile segments (16MB each), min 1 #checkpoint_timeout = 300 # in seconds, range 30-3600 #fsync = true # # Optimizer Parameters # #enable_seqscan = true #enable_indexscan = true #enable_tidscan = true #enable_sort = true #enable_nestloop = true #enable_mergejoin = true #enable_hashjoin = true #ksqo = false #effective_cache_size = 1000 # default in 8k pages #random_page_cost = 4 #cpu_tuple_cost = 0.01 #cpu_index_tuple_cost = 0.001 #cpu_operator_cost = 0.0025 # # GEQO Optimizer Parameters # #geqo = true #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_threshold = 11 #geqo_pool_size = 0 # default based on #tables in query, range 128-1024 #geqo_effort = 1 #geqo_generations = 0 #geqo_random_seed = -1 # auto-compute seed # # Debug display # #silent_mode = false #log_connections = false #log_timestamp = false #log_pid = false #debug_level = 0 # range 0-16 #debug_print_query = false #debug_print_parse = false #debug_print_rewritten = false #debug_print_plan = false #debug_pretty_print = false # requires USE_ASSERT_CHECKING #debug_assertions = true # # Syslog # # requires ENABLE_SYSLOG #syslog = 0 # range 0-2 #syslog_facility = 'LOCAL0' #syslog_ident = 'postgres' # # Statistics # #show_parser_stats = false #show_planner_stats = false #show_executor_stats = false #show_query_stats = false # requires BTREE_BUILD_STATS #show_btree_build_stats = false # # Access statistics collection # #stats_start_collector = true #stats_reset_on_server_start = true #stats_command_string = false #stats_row_level = false #stats_block_level = false # # Lock Tracing # #trace_notify = false # requires LOCK_DEBUG #trace_locks = false #trace_userlocks = false #trace_lwlocks = false #debug_deadlocks = false #trace_lock_oidmin = 16384 #trace_lock_table = 0 # # Misc # #dynamic_library_path = '$libdir' #australian_timezones = false #authentication_timeout = 60 # min 1, max 600 #deadlock_timeout = 1000 #default_transaction_isolation = 'read committed' #max_expr_depth = 10000 # min 10 #max_files_per_process = 1000 # min 25 #password_encryption = false #sql_inheritance = true #transform_null_equals = false ----- Original Message ----- From: "Andrew Sullivan" To: Sent: Wednesday, August 13, 2003 11:17 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, Aug 13, 2003 at 10:17:45AM -0500, ingrid martinez wrote: > > The query that execute is only inserts, I use a batch of 300 and then do > > commit. > > > > insert into FLOWS values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) > > Are there any foreign keys, &c? > > > > > and > > > > postgresql.conf looks like this > > [ . . .] > > The configuration is the default. You'll certainly want to increase > the shared memory and fiddle with some of the other usual pieces. > There is some discussion of the config file at > . > Unless the INSERTs are causing SELECTs, though, I can't see what > exactly might be causing you so much difficulty. > > A > > -- > ---- > Andrew Sullivan 204-4141 Yonge Street > Liberty RMS Toronto, Ontario Canada > M2P 2A8 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster From scott.marlowe@ihs.com Wed Aug 13 16:47:44 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0EAB2D1B58A for ; Wed, 13 Aug 2003 16:47:44 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36835-04 for ; Wed, 13 Aug 2003 13:46:06 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 5DCD7D1B561 for ; Wed, 13 Aug 2003 13:47:31 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h7DGkmbS000852; Wed, 13 Aug 2003 10:46:48 -0600 (MDT) Date: Wed, 13 Aug 2003 10:47:36 -0600 (MDT) From: "scott.marlowe" To: ingrid martinez Cc: Andrew Sullivan , Subject: Re: How can I Improve performance in Solaris? In-Reply-To: <00a001c361b6$d668a430$8e64a8c0@ingridmartinez> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/243 X-Sequence-Number: 3060 On Wed, 13 Aug 2003, ingrid martinez wrote: > Floes table looks like this > > Table "flows" > Column | Type | Modifiers > ----------------------+--------------------------+----------- > flidload | bigint | not null > firsttime | bigint | > fldestpeeraddress | character varying(30) | > fldesttransaddress | bigint | > fldesttranstype | smallint | > fldfromoctets | bigint | > fldscodepoint | smallint | > fldtooctets | bigint | > flfrompdus | bigint | > flid | text | > flidrule | bigint | > flsourcepeeraddress | character varying(30) | > flsourcetransaddress | bigint | > flsourcetranstype | smallint | > fltime | timestamp with time zone | > fltopdus | bigint | > lasttime | bigint | > sourceinterface | smallint | > destinterface | smallint | > sourceasn | smallint | > destasn | smallint | > Primary key: flows_pkey Which columns are in the pkey? From ingridm@qoslabs.com Wed Aug 13 16:56:19 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 659A6D1B58A for ; Wed, 13 Aug 2003 16:56:19 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 37951-09 for ; Wed, 13 Aug 2003 13:54:41 -0300 (ADT) Received: from correo (correo.qoslabs.com [157.238.87.78]) by svr1.postgresql.org (Postfix) with ESMTP id 413F1D1C936 for ; Wed, 13 Aug 2003 13:56:07 -0300 (ADT) Received: from ldap-02.qoslabs.com (ldap-02 [172.20.1.31]) by correo-01.qoslabs.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with SMTP id <0HJK00EK6HP4RF@correo-01.qoslabs.com> for pgsql-performance@postgresql.org; Wed, 13 Aug 2003 12:55:52 -0400 (EDT) Received: (from ingridmartinez [148.233.235.189]) by ldap-02.qoslabs.com (NAVGW 2.5.2.12) with SMTP id M2003081312555023228 ; Wed, 13 Aug 2003 12:55:51 -0400 Date: Wed, 13 Aug 2003 11:55:00 -0500 From: ingrid martinez Subject: Re: How can I Improve performance in Solaris? To: "scott.marlowe" Cc: Andrew Sullivan , pgsql-performance@postgresql.org Message-id: <00c601c361bb$a34c4890$8e64a8c0@ingridmartinez> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Mailer: Microsoft Outlook Express 6.00.2800.1158 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/244 X-Sequence-Number: 3061 the primary key is flidload ----- Original Message ----- From: "scott.marlowe" To: "ingrid martinez" Cc: "Andrew Sullivan" ; Sent: Wednesday, August 13, 2003 11:47 AM Subject: Re: [PERFORM] How can I Improve performance in Solaris? > On Wed, 13 Aug 2003, ingrid martinez wrote: > > > Floes table looks like this > > > > Table "flows" > > Column | Type | Modifiers > > ----------------------+--------------------------+----------- > > flidload | bigint | not null > > firsttime | bigint | > > fldestpeeraddress | character varying(30) | > > fldesttransaddress | bigint | > > fldesttranstype | smallint | > > fldfromoctets | bigint | > > fldscodepoint | smallint | > > fldtooctets | bigint | > > flfrompdus | bigint | > > flid | text | > > flidrule | bigint | > > flsourcepeeraddress | character varying(30) | > > flsourcetransaddress | bigint | > > flsourcetranstype | smallint | > > fltime | timestamp with time zone | > > fltopdus | bigint | > > lasttime | bigint | > > sourceinterface | smallint | > > destinterface | smallint | > > sourceasn | smallint | > > destasn | smallint | > > Primary key: flows_pkey > > Which columns are in the pkey? > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org From scott.marlowe@ihs.com Wed Aug 13 19:00:28 2003 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 91BFED1B524 for ; Wed, 13 Aug 2003 19:00:28 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 58372-02 for ; Wed, 13 Aug 2003 15:58:52 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 7E581D1C4BF for ; Wed, 13 Aug 2003 16:00:17 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h7DIxZbS011409; Wed, 13 Aug 2003 12:59:36 -0600 (MDT) Date: Wed, 13 Aug 2003 13:00:23 -0600 (MDT) From: "scott.marlowe" To: ingrid martinez Cc: Andrew Sullivan , Subject: Re: How can I Improve performance in Solaris? In-Reply-To: <00c601c361bb$a34c4890$8e64a8c0@ingridmartinez> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/246 X-Sequence-Number: 3063 More than likely you are suffering from an affliction known as type mismatch. This is listed as tip 9 here on the performance list (funny, it was sent at the bottom of your reply :-) What happens is that when you do: select * from some_table where id=123; where id is a bigint the query planner assumes you must want 123 cast to int4, which doesn't match int8 (aka bigint) and uses a sequential scan to access that row. I.e. it reads the whole table in. You can force the planner to do the right thing here in a couple of ways: select * from some_table where id=123::bigint; -- OR -- select * from some_table where id='123'; On Wed, 13 Aug 2003, ingrid martinez wrote: > the primary key is flidload > ---------------------------(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 >