Closed sophieclayton closed 9 years ago
Query?
min_max = scan(armbrustlab:seaflow:bead_stats_v4_byfile_untrans);
good_opp_vct = scan(armbrustlab:seaflow:good_opp_vct_v4);
min_maxb = select *,
INT(File_Id) as int_file
from min_max;
good_opp_vctb = select *,
INT(File_Id) as int_file
from good_opp_vct;
adjusted_particles = select d.fsc_small - m.fsc_avg as fsc_adj,
d.chl_small - m.chl_avg as chl_adj,
d.pe - m.pe_avg as pe_adj,
d.Cruise, d.Day, d.int_file as File_Id
from min_maxb as m, good_opp_vctb as d
where d.pop= "0"
or d.pop="1"
or d.pop="2"
or d.pop="3"
or d.pop="4"
or d.pop="5"
or d.pop="6"
or d.pop="7"
or d.pop="8"
or d.pop="9"
or d.pop="10"
or d.pop="cocco"
or d.pop="pico2"
or d.pop="pico5"
or d.pop="pico7"
or d.pop="ultra"
or d.pop="crypto"
or d.pop="nano"
or d.pop="pico3"
or d.pop="pico"
or d.pop="diatoms"
or d.pop="lgdiatoms"
or d.pop="pico6"
or d.pop="pico1"
or d.pop="smdiatoms"
or d.pop="pico4"
or d.pop="nano2"
or d.pop="pico9"
or d.pop="pico8"
or d.pop="prochloro"
and d.Cruise = m.Cruise
and d.Day = m.Day
and d.int_file = m.int_file;
store(adjusted_particles, armbrustlab:seaflow:adj_byfile_phytoexp_untrans);
Just as a side note. I believe and has precedence over or so your query is interpreted as
adjusted_particles = select d.fsc_small - m.fsc_avg as fsc_adj,
d.chl_small - m.chl_avg as chl_adj,
d.pe - m.pe_avg as pe_adj,
d.Cruise, d.Day, d.int_file as File_Id
from min_maxb as m, good_opp_vctb as d
where d.pop= "0"
or d.pop="1"
...
or d.pop="pico4"
or d.pop="nano2"
or d.pop="pico9"
or d.pop="pico8"
((or d.pop="prochloro"
and d.Cruise = m.Cruise)
and d.Day = m.Day
and d.int_file = m.int_file);
@dhalperi correct me if I'm wrong.
@domoritz must be right.
My guess is the compiler is spending too long trying to optimize where all those or
s go. I'll look into it.
ok, so what it the best way of structuring that query?
On Tue, Mar 10, 2015 at 3:29 PM, Daniel Halperin notifications@github.com wrote:
@domoritz https://github.com/domoritz must be right.
— Reply to this email directly or view it on GitHub https://github.com/uwescience/myria-web/issues/263#issuecomment-78162590 .
Sophie Clayton, PhD School of Oceanography Box 357940 University of Washington Seattle, WA 98195, USA
tel: +1 (206) 685-1047 http://sophieclayton.github.io http://armbrustlab.ocean.washington.edu/people/clayton
It would be like this:
adjusted_particles = select d.fsc_small - m.fsc_avg as fsc_adj,
d.chl_small - m.chl_avg as chl_adj,
d.pe - m.pe_avg as pe_adj,
d.Cruise, d.Day, d.int_file as File_Id
from min_maxb as m, good_opp_vctb as d
where (d.pop= "0"
or d.pop="1"
...
or d.pop="pico4"
or d.pop="nano2"
or d.pop="pico9"
or d.pop="pico8"
or d.pop="prochloro")
and d.Cruise = m.Cruise
and d.Day = m.Day
and d.int_file = m.int_file;
all I did was move the parens
however that still will take too long to parse – it's taking over a minute on my laptop to parse a similar example.
ok, thanks!
On Tue, Mar 10, 2015 at 3:52 PM, Daniel Halperin notifications@github.com wrote:
It would be like this:
adjusted_particles = select d.fsc_small - m.fsc_avg as fsc_adj, d.chl_small - m.chl_avg as chl_adj, d.pe - m.pe_avg as pe_adj, d.Cruise, d.Day, d.int_file as File_Id from min_maxb as m, good_opp_vctb as d where (d.pop= "0" or d.pop="1" ... or d.pop="pico4" or d.pop="nano2" or d.pop="pico9" or d.pop="pico8" or d.pop="prochloro") and d.Cruise = m.Cruise and d.Day = m.Day and d.int_file = m.int_file;
all I did was move the parens
— Reply to this email directly or view it on GitHub https://github.com/uwescience/myria-web/issues/263#issuecomment-78166038 .
Sophie Clayton, PhD School of Oceanography Box 357940 University of Washington Seattle, WA 98195, USA
tel: +1 (206) 685-1047 http://sophieclayton.github.io http://armbrustlab.ocean.washington.edu/people/clayton
That is actually interesting. Can we add this query into raco test case?
These "or"s on single table should be either pushed down postgres or just be treated as filter conditions of doing scans.
Hi Soph, try again using the restructured query (parentheses moved)?
i'm trying to parse/run a query and am getting this error: