[SQL] unsubscribe

2004-02-05 Thread Mona H. Kapadia
---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Slow sub-selects, max and count(*)

2004-02-05 Thread Josh Berkus
Richard, > Ian you suggested a simular problem was solved using "exists" rather than "in". I am not sure how the use differs. I have tried to include it in option 4 below. Hmmm ... this piece of advice is dated; with PG 7.4, IN() queries should be plenty fast. If you're using 7.3 or less, th

Re: [SQL] Slow sub-selects, max and count(*)

2004-02-05 Thread Bruno Wolff III
On Thu, Feb 05, 2004 at 15:53:08 +0800, Richard Sydney-Smith <[EMAIL PROTECTED]> wrote: > Trial Solutions: > > 1) delete from fsechist where hist_q in (select hist_q from fsechist, > temp_shareprices where hist_tick = ticker and dte = hist_date); Don't you want: delete from fsechist where hist

Re: [SQL] Slow sub-selects, max and count(*)

2004-02-05 Thread Richard Sydney-Smith
Thanks Josh and Ian,   narrowing the problem down. The really slow line is the one where I try and remove potential duplicates. It does not look at the indexes.   Point on using copy rather than insert is taken. I use copy to load to a temp file so I can test the data and alter certain value

[SQL] Could not convert UTF-8 to ISO8859-1

2004-02-05 Thread Chris Anderson
I've noticed a difference in behavior between 7.2 and 7.3 with regards to character recoding and I'm a little perplexed about how to work around. I have a database in LATIN-1 that is accessed read-write by a Java app. Naturally, the Java code keeps all of its strings in UTF8 so when I prepare

Re: [SQL] TIME ZONE SQL

2004-02-05 Thread Tom Lane
"Raman Garg" <[EMAIL PROTECTED]> writes: > Actually my "between" is creating some problems and is not giving me results > so what I have done is . IN MY WHERE CLAUSE OF QUERY: I suspect that this revised clause will give you problems too, namely selecting rows you don't want. I think what may act

Re: [SQL] TIME ZONE SQL

2004-02-05 Thread Richard Huxton
On Thursday 05 February 2004 14:59, Raman Garg wrote: > Hi Richard, > > What I am having is > > CREATE TABLE "customer_events" ( > "event_id" numeric (10) NOT NULL, > "customer_id" numeric (10) NOT NULL, > "event_name" varchar (100) , > "event_datetime" date , > "start_time" time , > "repeat_untill

Re: [SQL] TIME ZONE SQL

2004-02-05 Thread Raman Garg
Hi Richard, What I am having is CREATE TABLE "customer_events" ( "event_id" numeric (10) NOT NULL, "customer_id" numeric (10) NOT NULL, "event_name" varchar (100) , "event_datetime" date , "start_time" time , "repeat_untill_date" date , "send_before_time" time, "time_difference" time PRIMARY KEY

Re: [SQL] TIME ZONE SQL

2004-02-05 Thread Richard Huxton
On Thursday 05 February 2004 08:28, Raman wrote: > Hi Richard, > Follwing are the Results that I get > WHEN I run "between" query like > > ((CURRENT_TIME(0) AT TIME ZONE "interval" (time_difference)) BETWEEN > (start_time::time - send_before_time::time) > and start_time::time) I think the issue i

Re: [SQL] TIME ZONE SQL

2004-02-05 Thread Raman
Hi Richard, Follwing are the Results that I get Lets say I am in IST (Indian standart time) 15:00:00 hrs so equivalent time at US Mountain (-7:00) is 02:30:00 hrs and equivalent time at Japan(+9:00) is 18:30:00hrs NOW WHAT I have is this I have following fields in my table "customer_events" a)