Adding unique key's to dataset?
As with a physical database structure, adding indexes and primary keys help increase the efficiency of SQL execution. Is there a way in DOMO to enforce a primary key or unique constraint? I ask because i have a simple SQL in my dataflow that combines 4 existing datasets, and it is taking quite a long time for the Dataflow to run.
Comments
-
If you're using mySQL dataflows you can add indexes on transform tables. It is definitely recommended for mySQL dataflows. This article in the knowledge base talks about it.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
THat works on the specific dataflow, however what if i want to put all those indexes directly on the dataset? So if i have 15 datasets coming from those 4 tables, i dont want to create 4 transformations on each flow. Just apply one to the data table itself, and then it is there.
Is that possible?
0 -
ALTER TABLE wo_job_hv ADD INDEX('flctr_bu_id'),add index('work_order_number'), add index('tech_id') , add index('src_db_id')
I did this as it relates to the article, after running for 45 minutes it errored with ...
The database reported a syntax error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''flctr_bu_id'),add index('work_order_number'), add index('tech_id') , add index(' at line 1
Is there something wrong with that syntax?
0 -
No, you can't manage your data to that level. Not where it sets in permanent storage ("Vault"). You'd only want to do that if cards weren't rendering fast enough.
If dataflows are too slow, you can, however, write a procedure in each dataflow to create all indexes in one transform, then call the procedure in the next transform. That's two steps instead of four, at least.
That would look like:
Transform1
CREATE PROCEDURE IndexA()
BEGIN
ALTER TABLE expenses ADD INDEX(`Date`,`ID`);
ALTER TABLE rebeimbursements ADD INDEX(`Date`,`ID`);
ENDTransform2
Call IndexA();
Alternatively, you could write your dataflows in Redshift SQL instead. See my recent comment on the post here. Many heavy users of SQL dataflows prefer Redshift, especially for larger datasets.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 602 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 695 Beast Mode
- 43 App Studio
- 39 Variables
- 658 Automate
- 170 Apps
- 441 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 386 Distribute
- 111 Domo Everywhere
- 269 Scheduled Reports
- 6 Software Integrations
- 113 Manage
- 110 Governance & Security
- 8 Domo University
- 30 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive