Re: [SQL] Poor performance on a right join

2003-03-17 Thread dev
> Here's the EXPLAIN output: > > EXPLAIN ANALYZE 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 > = '847-478-2100') order by a.call_date desc; > NOTICE: QUERY PLAN: > > Sort (cost=14320.04..14320.04 rows=6046

Re: [SQL] Poor performance on a right join

2003-03-17 Thread Tom Lane
Carmen Sarlo <[EMAIL PROTECTED]> writes: > EXPLAIN ANALYZE 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 = '847-478-2100') order by a.call_date desc; This query is rather pointless as-is: the WHERE clause wi

Re: [SQL] Poor performance on a right join

2003-03-14 Thread dev
> 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_

[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