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.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive