pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Slow Executing queries
2+ messages / 2 participants
[nested] [flat]

* Slow Executing queries
@ 2002-12-17 23:03 Ing. Gabriel Monsalvo <gmonsalvo@rentastucuman.gov.ar>
  2002-12-18 14:30 ` Re: Slow Executing queries Administrador Squid <squid@maxiconsumo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Ing. Gabriel Monsalvo @ 2002-12-17 23:03 UTC (permalink / raw)
  To: pgsql-admin

<FONT face="Courier New">Tom:<BR><BR>We have a IBM NetServer i with 2.5 GB
de Ram and RAID 5 with 137 GB, two<BR>PIV Xeon at 1.6 GHZ... I mounted Linux
in this server with<BR>PostgreSQL 7.3, we start to deploy the database and
we have a lot of<BR>performance problems, i need help for tune up the
server....i read the faqs,<BR>a lots of documents about gets better
performance but i don't obtain good<BR>results...for example this table:
OBLIGACION have 15 millions of records<BR><BR>Column | Type |
Modifiers<BR>----------+-----------------------+-----------<BR>cuil |
numeric(11,0) |<BR>objeto | character varying(11) |<BR>impuesto |
numeric(3,0) |<BR>concepto | numeric(3,0) |<BR>tipobj | numeric(3,0)
|<BR>fecvtop | date |<BR>fecvtod | date |<BR>graba | date |<BR>fecgen | date
|<BR>hora | character varying(4) |<BR>operador | character varying(10)
|<BR>numoble | numeric(13,0) |<BR>puesto | numeric(3,0) |<BR>secsec |
numeric(4,0) |<BR>periodo | numeric(6,0) |<BR>cuota | numeric(3,0)
|<BR>ctrlpago | numeric(3,0) |<BR>ddjjd | numeric(3,0) |<BR>tipopp |
numeric(4,0) |<BR>nroppago | numeric(8,0) |<BR>marca | numeric(3,0)
|<BR>Indexes: numoble_oblig btree (numoble),<BR>objeto_oblig btree
(objeto),<BR>periodo_oblig btree (periodo)<BR><BR>sapym=# explain select
max(numoble) from obligacion where periodo=200100;<BR>QUERY
PLAN<BR>----------------------------------------------------------------------------<BR>-----------------------<BR>Aggregate
(cost=6983070.47..6983070.47 rows=1 width=16)<BR>-&gt; Index Scan using
periodo_oblig on obligacion (cost=0.00..6978186.18<BR>rows=1953717
width=16)<BR>Index Cond: (periodo = 200100::numeric)<BR>(3
rows)<BR><BR>&gt;&gt; there is a index for obligacion on periodo but this
query takes over 2<BR>minutes for finish.<BR><BR><BR>sapym=# explain select
count(*) from obligacion where periodo=200100;<BR>QUERY
PLAN<BR>----------------------------------------------------------------------------<BR>----------------------<BR>Aggregate
(cost=6983070.47..6983070.47 rows=1 width=0)<BR>-&gt; Index Scan using
periodo_oblig on obligacion (cost=0.00..6978186.18<BR>rows=1953717
width=0)<BR>Index Cond: (periodo = 200100::numeric)<BR>(3 rows)<BR><BR>can
you help to solve the problem? i really want to use PostgreSQL in
my<BR>organization but if i can't solve this problem we must<BR>migrate to
ugly DB2 .<BR><BR>thanks in advance.<BR><BR>Gabriel
Monsalvo</FONT><BR><BR><br><br><br><br>
<br>
________________________________________________________________________<br><br>
<font name=verdana> Este Mail Ha sido enviado por <a
href='http://www.correomovil.com.ar'><b>CorreoMovil</b></a; - Su cuenta POP
este donde este</font><br>
<br>




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Slow Executing queries
  2002-12-17 23:03 Slow Executing queries Ing. Gabriel Monsalvo <gmonsalvo@rentastucuman.gov.ar>
@ 2002-12-18 14:30 ` Administrador Squid <squid@maxiconsumo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Administrador Squid @ 2002-12-18 14:30 UTC (permalink / raw)
  To: Ing. Gabriel Monsalvo <gmonsalvo@rentastucuman.gov.ar>; +Cc: pgsql-admin

Gabriel:
 No soy un administrador de mucha experiencia, pero también sufrí muchos 
problemas de rendimiento hasta que modifiqué
dos parámetros en postgresql.conf y en el kernel.
  Los parámetros que cambie en postgresql.conf son "sort_mem", donde 
debes poner cuantos kilobytes va a utilizar cada proceso
cuando deba realizar el ordenamiento de una tabla (ojo que si pones 10 
megabytes. en este parámetro son 10 megabytes. por cada proceso que
esté realizando un ordenamiento en ese momento), y el otro es 
"shared_buffers", que es la cantidad de bloques de 8 kb. que se van
a utilizar de memoria compartida, para subir las tablas completas a 
memoria, por ejemplo.  Este último espacio se ocupa una única vez
y lo utilizan todos los procesos que cree el postmaster.
 Mi (modesta) configuración es:
 sort_mem = 1024 (un megabyte)
 shared_buffers = 2048 (16 megabytes)
 Seguramente tus números van a ser más grandes y quizá debas modificar 
un par de parámetros del kernel vía /etc/sysctl.conf y luego
ejecutar sysctl.
 Los parámetros que hay que tocar son shmall y shmmax y los valores se 
deben expresar en bytes.  El valor que se debe poner debe
ser igual o mayor (expresado en bytes por supuesto) que el de 
shared_buffers.

 Quizá esto ya lo hayas probado, si no que sirva, te mando unos enlaces 
interesantes de donde saque esta información y otros datos
copados.

http://candle.pha.pa.us/main/writings/pgsql/hw_performance/index.html
http://candle.pha.pa.us/main/writings/pgsql/performance.pdf

 Saludos,

Juan M. Fera
Maxiconsumo S.A.

Ing. Gabriel Monsalvo escribió:

> Tom:
>
> We have a IBM NetServer i with 2.5 GB de Ram and RAID 5 with 137 GB, two
> PIV Xeon at 1.6 GHZ... I mounted Linux in this server with
> PostgreSQL 7.3, we start to deploy the database and we have a lot of
> performance problems, i need help for tune up the server....i read the 
> faqs,
> a lots of documents about gets better performance but i don't obtain good
> results...for example this table: OBLIGACION have 15 millions of records
>
> Column | Type | Modifiers
> ----------+-----------------------+-----------
> cuil | numeric(11,0) |
> objeto | character varying(11) |
> impuesto | numeric(3,0) |
> concepto | numeric(3,0) |
> tipobj | numeric(3,0) |
> fecvtop | date |
> fecvtod | date |
> graba | date |
> fecgen | date |
> hora | character varying(4) |
> operador | character varying(10) |
> numoble | numeric(13,0) |
> puesto | numeric(3,0) |
> secsec | numeric(4,0) |
> periodo | numeric(6,0) |
> cuota | numeric(3,0) |
> ctrlpago | numeric(3,0) |
> ddjjd | numeric(3,0) |
> tipopp | numeric(4,0) |
> nroppago | numeric(8,0) |
> marca | numeric(3,0) |
> Indexes: numoble_oblig btree (numoble),
> objeto_oblig btree (objeto),
> periodo_oblig btree (periodo)
>
> sapym=# explain select max(numoble) from obligacion where periodo=200100;
> QUERY PLAN
> ----------------------------------------------------------------------------
> -----------------------
> Aggregate (cost=6983070.47..6983070.47 rows=1 width=16)
> -> Index Scan using periodo_oblig on obligacion (cost=0.00..6978186.18
> rows=1953717 width=16)
> Index Cond: (periodo = 200100::numeric)
> (3 rows)
>
> >> there is a index for obligacion on periodo but this query takes over 2
> minutes for finish.
>
>
> sapym=# explain select count(*) from obligacion where periodo=200100;
> QUERY PLAN
> ----------------------------------------------------------------------------
> ----------------------
> Aggregate (cost=6983070.47..6983070.47 rows=1 width=0)
> -> Index Scan using periodo_oblig on obligacion (cost=0.00..6978186.18
> rows=1953717 width=0)
> Index Cond: (periodo = 200100::numeric)
> (3 rows)
>
> can you help to solve the problem? i really want to use PostgreSQL in my
> organization but if i can't solve this problem we must
> migrate to ugly DB2 .
>
> thanks in advance.
>
> Gabriel Monsalvo
>
>
>
>
>
>
> ________________________________________________________________________
>
> Este Mail Ha sido enviado por CorreoMovil 
> <http://www.correomovil.com.ar; - Su cuenta POP este donde este
>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-12-18 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-17 23:03 Slow Executing queries Ing. Gabriel Monsalvo <gmonsalvo@rentastucuman.gov.ar>
2002-12-18 14:30 ` Administrador Squid <squid@maxiconsumo.com>

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