ALTER in procedure

Radovan Bičiště radovan.biciste at ceosdata.com
Tue Jul 23 10:07:52 CEST 2013


Hi Stefan,
Thank you for a brisk answer.
I'm aware of the conflict with standards. We are mostly Oracle shop.

Reason for disabling constraints is speed of loading. But maybe we 
should use different approach like indexing. We have started to use 
MonetDB recently.
We have a table hundreds millions of rows and we are tagging data in it.
Example SQL:
     INSERT INTO crmkartastitek (
       cislo_karty,
       stitek_id,
       stitek_nazev,
       stitek_upresneni
      )
      SELECT DISTINCT 
cislo_karty,v_stitek_id,v_stitek_nazev,v_stitek_upresneni
       FROM (SELECT cislo_karty
         FROM crmkartapohyby p
         JOIN crmkartaaktivita k ON p.cislo_karty=k.cislo_karty
         WHERE 1=1
          AND k.aktivita > 0
          AND p.pohyb IN ('VR','VV')
          AND p.datum BETWEEN (p_datum - INTERVAL '12' MONTH) AND 
(p_datum - INTERVAL '1' DAY)
         GROUP BY p.cislo_karty
         HAVING SUM(castka_r + castka_d) > SUM(castka_v)
       ) AS sumy_castek_pohybu;

The big table is crmkartapohyby. Data to the table is fed from Oracle 
through mclient java interface.

Thank you for any hints,
Radovan

On 07/23/2013 09:55 AM, Stefan Manegold wrote:
> Hi Radovan,
>
> I'm afraid that MonetDB does not allow any schema manipulation with SQL procedures (or functions).
> I'm actually not sure, whether the SQL standard allows that ...
>
> Having said that, why would you want to drop constraints while loading data, only to add them afterwards, again?
>
> Best,
> Stefan
>



More information about the users-list mailing list