[PERFORM] Sequencial scan in a JOIN

2012-06-05 Thread Andrew Jaimes
Hi everyone, I am trying to run the following query: SELECT count(1) --DISTINCT l_userqueue.queueid FROM e_usersessions JOIN l_userqueue ON l_userqueue.userid = e_usersessions.entityid JOIN a_activity ON a_activity.activequeueid = l_userqueue.queueid AND a_activity.vstatus

Re: [PERFORM] Sequencial scan in a JOIN

2012-06-05 Thread Shaun Thomas
On 06/05/2012 07:48 AM, Andrew Jaimes wrote: ' -> Hash Join (cost=10.93..99795.09 rows=242803 width=0) (actual time=0.541..2249.027 rows=33 loops=1)' 'Hash Cond: ((a_activity.activequeueid = l_userqueue.queueid) AND (a_activity.sbuid = e_usersessions.sbuid))' '-> Seq Scan on

Re: [PERFORM] Sequencial scan in a JOIN

2012-06-05 Thread Andrew Jaimes
the default_statistics_target is set to 200, and I have run the analyze and reindex on these tables before writing the email. Andrew > Date: Tue, 5 Jun 2012 08:15:45 -0500 > From: stho...@optionshouse.com > To: andrewjai...@hotmail.com > CC: pgsql-performance@postgresql.org > Subject: Re:

Re: [PERFORM] Sequencial scan in a JOIN

2012-06-05 Thread Shaun Thomas
On 06/05/2012 08:31 AM, Andrew Jaimes wrote: the default_statistics_target is set to 200, and I have run the analyze and reindex on these tables before writing the email. Out of idle curiosity, how do these two variants treat you? SELECT count(1) FROM e_usersessions s JOIN l_userqueue q O

Re: [PERFORM] Sequencial scan in a JOIN

2012-06-05 Thread Shaun Thomas
On 06/05/2012 09:41 AM, Andrew Jaimes wrote: The second query ran better than the first one: That's what I figured. Ok, so looking back to your original message again: CREATE INDEX i08_a_activity ON a_activity USING btree (activequeueid , vstatus , ventrydate ); Based on the query here

[PERFORM] Missing block Magic

2012-06-05 Thread Alejandro Carrillo
Hi, I want to make a function in C for postgresql, this is the code: #define _USE_32BIT_TIME_T #define BUILDING_DLL 1 #include "postgres.h" #include "fmgr.h" #include "executor\spi.h" /* SPI - Server Programming Interface */ #if defined(_MSC_VER) || defined(__MINGW32__) #define PG_GETINF_EXPOR

Re: [PERFORM] Missing block Magic

2012-06-05 Thread Tom Lane
Alejandro Carrillo writes: > ERROR:  biblioteca «C:\Documents and > Settings\Administrador\Escritorio\test\test.dll» incompatible: no se > encuentra el bloque mágico > HINT:  Se requiere que las bibliotecas de extensión usen la macro > PG_MODULE_MAGIC. [ scratches head ... ] Your source code

Re: [PERFORM] Missing block Magic

2012-06-05 Thread Alejandro Carrillo
I restart and doesn't work. :( Please help me! > > De: Tom Lane >Para: Alejandro Carrillo >CC: "pgsql-performance@postgresql.org" >Enviado: Martes 5 de junio de 2012 12:00 >Asunto: Re: [PERFORM] Missing block Magic > >Alejandro Carrillo writes: >> ERROR