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

2004-03-29 Thread Josh Berkus
Greg, Please don't confuse the issue by throwing Max() and Count() into the same basket. When on earth is that post of mine from? Seems like it's several months, if not a couple of years, old. -- -Josh Berkus Aglio Database Solutions San Francisco ---(end of

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

2004-03-27 Thread Greg Stark
Josh Berkus [EMAIL PROTECTED] writes: Max() and Count() cannot use indexes for technical reasons. Browse through the archives of SQL, PERFORM, and HACKERS for about 12,000 discussions on the subject. Please don't confuse the issue by throwing Max() and Count() into the same basket. The

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

2004-02-05 Thread Richard Sydney-Smith
Thanks Josh and Ian, narrowing the problem down. The reallyslow 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 values.

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_q in

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

2004-02-04 Thread Richard Sydney-Smith
Ihave a procedure ( included below with table definition) to import end of day quotes into a table fsechist. The issue is with the speed ( or lackof it) that the procedure proceeds. Apparently it is the subselects that are the worst issue and I have tried to replace these. Also max() and

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

2004-02-04 Thread Josh Berkus
Richard, The issue is with the speed ( or lackof it) that the procedure proceeds. Apparently it is the subselects that are the worst issue and I have tried to replace these. Also max() and count() refuse to use indexes. Max() and Count() cannot use indexes for technical reasons. Browse

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

2004-02-04 Thread Iain
, 2004 10:48 AM Subject: [SQL] Slow sub-selects, max and count(*) Ihave a procedure ( included below with table definition) to import end of day quotes into a table fsechist. The issue is with the speed ( or lackof it) that the procedure proceeds. Apparently it is the subs