Hi, a simple multiplication plus global sum will be executed byt two simple scans, one over the two base column to calculate the multiplication and one over the multiplication result to calculate the sum. There is not need for or benefit from any index. MonetDB will caluculate the result as fast as your machine (CPU speed, memory size and speed, disk speed) allows. Stefan On Tue, Dec 04, 2012 at 03:52:10PM -0300, Ivan Videla wrote:
Hi All,
I have a table with 268 millions of records from supermarket transactions tran_id, prod_id, quantity, price, cost and i want to make a calculation like sum(quantity*(price-cost)). But this query takes too much time. I want to know if i can improve the results using an index. Or monetdb itself use an index on-the-fly. If not i would like to know how can i make an index to improve the execution time.
Regards, Ivan _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) | _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list