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.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive