Re: [SQL] Query Plan

2007-07-12 Thread Gregory Stark
"Radhika Sambamurti" <[EMAIL PROTECTED]> writes: > When I run the query with combination of FirmClearingID & status the run > times are approx 3700ms. > But when I add tradedate ie date_trunc('day', tradedate) = '20070703' the > run time becomes a horrendous 19631.958 ms. I'm not really able to m

[SQL] Query Plan

2007-07-12 Thread Radhika Sambamurti
Hi, I have a complicated view joining 3 tables. Here are the run times: LOG: duration: 3380.672 ms statement: explain analyze SELECT * from vtradeblock where FirmClearingid = 'FIRMA' and status = 1; LOG: duration: 3784.152 ms statement: explain analyze SELECT * from vtradeblock where date_tr

Re: [SQL] Query Plan

2004-09-09 Thread Richard Huxton
Theo Galanakis wrote: Have a question regarding when a Query Plan uses an Index. I have a basic statement This query uses the Index Scan: explain analyse select * from tablea where columna_id < 57 This query uses Seq Scan: explain analyse select * from tablea where columna_id < 58 There are about 5

[SQL] Query Plan

2004-09-08 Thread Theo Galanakis
Title: Query Plan Have a question regarding when a Query Plan uses an Index. I have a basic statement This query uses the Index Scan: explain analyse select * from tablea where columna_id < 57 This query uses Seq Scan: explain analyse select * from tablea where columna_id < 58 There a

Re: [SQL] Query plan discrepancies

2004-07-16 Thread Rod Taylor
Have you run ANALYZE recently? Please send back EXPLAIN ANALYZE for the below query. > EXPLAIN from DB 2 (doesn't come back): >QUERY PLAN >

[SQL] Query plan discrepancies

2004-07-16 Thread Bob Arens
Hi, I have two databases that were created with identical schemas and both filled in the exact same way, with the same indices etc., yet they give different query paths for identical SELECTs. Normally this wouldn't bug me, but one DB returns the select in relatively short order, while the other one