[SQL] Poor performance on a right join

2003-03-13 Thread Carmen
When doing a join query I am getting a responce time of 3 seconds. The
callhist table has 66000 rows and the phone table has 1 rows. I
have an indexes on callhist.call_date, callhist.operator_id,
phone.phone, & phone.cust_code. Here's the SQL
SELECT a.CALL_DATE, a.OPERATOR_ID, a.CUST_CODE FROM PHONE as b right
join CALLHIST as a on (a.CUST_CODE=b.CUST_CODE) where (b.PHONE =
'555-555-') order by a.call_date desc;
The postgres db is running on a 2 P3 700 processor server with 1GB of
ram running Red Hat Linux 7.3. I am running PostgreSQL 7.2.2

Why is the query taking so long? What can I do to help the
performance?

Thanks in advance,

Carmen

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] Problem on PostgreSQL (error code, store procedures)

2002-07-08 Thread Carmen Wai

Hello,

I would like to know if there are any global variables
storing the error code or the number of rows affected
after each execution of the SQL statement.

Also, for Postgresql function, I have checked that I
can only call the function by: select function(parms)
or by EXECUTE PROCEDURE function(parms) in the trigger
action. I wonder whether there is any other method for
calling the function which is similar to the stored
procedures in the MS SQL server?

Thank a lot!
Carmen  

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]





[SQL] No command history in psql

2002-07-24 Thread Carmen Wai

Hello:

I am upgrading to postgresql version 7.2.1. I found that the psql has not 
included the readline library automatically and doesn't have any readline 
and history command function. So I configure the postgresql with option 
--with-includes=/usr/local/include and --with-libs=/usr/libs/ so that it 
should be able to search for the corresponding library and header files 
(libreadline.a, history.h, readline.h). But it still fails Does anyone 
get any idea??

Thanks a lot!

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] Case in-sensitive

2002-07-24 Thread Carmen Wai

Hello:

Can I config the Postgresql so that it can match case in-sensitive pattern 
automatically? i.e. I don't need to explicit convert the pattern to lower 
case like this: .WHERE lower(textfield) LIKE lower(pattern)

Thanks a lot!

Carmen

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



[SQL] vacuum and serial primary keys

2003-02-01 Thread Carmen Marincu
Hello -

I am using Postgresql 7.1.3 and I have deleted 3000 rows from a table
(with DELETE).
Than I used vacuum  to actually delete the rows markes as deleted
by the DELETE command..
The trouble is that the "counter" for the serial primary key (ID field)
wasn't reset. So now althought I have only 2 rows in my table they have
the ID 3001 and 3002.

Is this normal ? If not could someone please explain me how could  I reset
the "counter" to ignore the deleted rows ?

Thank you very much
Carmen



---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org