SlideShare a Scribd company logo
Distributed Queries in IDS:  New features in IDS. Keshava Murthy,  Architect, Informix Software.  IBM,  [email_address] Session Number 2988
Introduction to distributed query Configuring IDS for distributed queries What’s new in IDS v10 and v11 Enhancements in IDS v10 Enhancements in IDS v11 Future directions and feedback
inventorydb Application Application IDS Server:  order_server IDS Server: eduserver Application orderdb payrolldb edudb CROSS-Database SELECT o.ordid, i.invdesc FROM  orderdb:orders o ,  inventorydb:inventory i Where o.customerid = 1234  and o.ordinvid = i.invid; CROSS-Database SELECT p.empid, c.course FROM  payrolldb:employees e,  edudb:course c WHERE p.empid = 1234 And p.courseid = c.coursid
inventorydb Application Application order_server  orderdb emp_server empdb Application orderdb payrolldb edudb CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM  payrolldb@emp_server:employees e,   orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid
Scenarios to use distributed queries. Need to access the latest data. Centralized control Data is in different systems – be in same or different location. Data can be in multiple version of IDS or XPS Data integration Heterogeneous data base systems.
When to use distributed queries. Real time data access and modification. Reliable data access and modifications. Need full 2-phase commit support  Used by the transaction manager at the co-ordinator Commit phase goes thru 2 phases 1 st  phase: PREPARE to COMMIT 2 nd  phase: commit  if all the polled servers are OK.
CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM  payrolldb@emp_server:employees e,   orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid inventorydb order_server:orderdb orderdb server2 server3 server5 server4
sqlhosts Inventorysrv  onsoctcp  myinv.domaon.com 5463 orderserver  onsoctcp  9.48.52.345  4526 Informix server name Network protocol IP address Port number
QUERY: ------ SELECT t.col1 FROM orderby@server1:tab1 t ORDER BY t.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 Temporary Files Required For: Order By 1) sqlqa.t: SEQUENTIAL SCAN QUERY: ------ SELECT rt1.col1 FROM orderby@server2:tab1 rt1 ORDER BY rt1.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 1) sqlqa.rt1: REMOTE PATH Remote SQL Request:  select x0.col1 from orderby:"sqlqa".tab1 x0 order by x0.col2
QUERY: ------ select a1.t1c2, a2.t2c2, a3.t3c2, a4.t4c2 from (rdb2@server2:t1 a1 left join rdb2@server2:t2 a2 on a1.t1c1 = a2.t2c1) cross join (rdb2@server2:t3 a3 left join rdb2@server2:t4 a4  on a3.t3c1 = a4.t4c1) Estimated Cost: 7 Estimated # of Rows Returned: 11 1) sqlqa.a3, sqlqa.a4: REMOTE PATH Remote SQL Request:  select x0.t3c1 ,x0.t3c2 ,x1.t4c1 ,x1.t4c2 from (rdb2:"sqlqa".t3 x0 left join rdb2:"sqlqa".t4 x1 on (x0.t3c1 = x1.t4c1 ) ) 2) sqlqa.a1, sqlqa.a2: REMOTE PATH Remote SQL Request: select x2.t1c1 ,x2.t1c2 ,x3.t2c1 ,x3.t2c2 from ((rdb2:"sqlqa".t1 x2 left join rdb2:"sqlqa".t2 x3 on (x2.t1c1 = x3.t2c1 ) )) NESTED LOOP JOIN
Informix Dynamic Server Datatypes SET Complex Datatypes Basic SQL Types Numeric Character Time Large Objects Extended Data types Collection Row Types Multi-Set List Distinct Builtin-extended Boolean, lvarchar, blob, clob opaque User Defined Datatypes
Built-in SQL Datatypes Character Numeric LargeObjects Time Char Varchar Nchar Nvarchar Int Int8 float Decimal Numeric Money Smallint Smallfloat Serial Serial8 Bigint Bigserial datetime Interval date Text Byte
Built-in Extended types Boolean LVARCHAR BLOB CLOB
Cross-Database Queries – one server IDS v10 and above New Extended Data types support Built-in UDTS across databases, single server instance BOOLEAN LVARCHAR BLOB CLOB Non built-in UDTS across databases in a single server instance, with explicit cast to LVARCHAR Boolean, LVARCHAR, BLOB and CLOB are commonly used in applications.
Cross-Database Queries – one server IDS v10 and above New types can be used in Direct DML Views Synonyms Stored procedure parameters and return types C and Java UDRs
Cross Database example: SELECT DATABASE orderdb; SELECT item_num,item_desc,item_specs,item_pic,item_life FROM  inventorydb:itemtab WHERE item_num = 1; SELECT  item_sm_pk::LVARCHAR,item_lg_pk::varchar FROM  inventorydb:itemtab WHERE item_num = 2;
Cross Database example: INSERT Insert on Remote table having built-in udts INSERT INTO remotedb:remtab  (boolean_col, lvarchar_col, blob_col, clob_col)  VALUES (‘t’, “lvarchar_data”, Filetoblob(‘blobfile’, ‘client’), Filetoclob(‘clobfile’, ‘client’)) Insert into remote table Select from local table built-in udts INSERT INTO remotedb:remtab  ( boolean_col, lvarchar_col, blob_col, clob_col) SELECT bool_col, lvar_col, b_col, c_col  FROM local_tab WHERE bool_col = “t”; Insert on Remote table non built-in UDTs INSERT INTO remotedb:remtab (udt1_col) SELECT udt_col::lvarchar  FROM local_tab WHERE udt2_col::lvarchar = “ldata2row1”;
Cross Database example: UPDATE/DELETE DATABASE orderdb; UPDATE inventorydb:itemtab SET (item_lg_pk) =  ((SELECT order_lg_pk::lvarcharFROM ordertab WHERE order_sm_pk::lvarchar = "box(2,2,2,2)")) WHERE order_shelf_life = "t";
Cross Database example: CREATE VIEW DATABASE orderdb; CREATE VIEW item_pk_view AS SELECT item_lg_pk::lvarchar, item_sm_pk::varchar FROM inventorydb:itemtab WHERE item_sm_pk::char matches "box(2,2,2,2)*"
CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM  payrolldb@emp_server:employees e,   orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid Cross Server inventorydb order_server:orderdb orderdb server2 server3 server5 server4
Enhancements in IDS v11.10 Cross-Server queries now support Boolean Lvarchar Distinct types of Boolean and Lvarchar Distinct types of built-in SQL types Numeric (int, decimal, etc) character (char, varchar, etc) Time (datetime) No support for blob and clob yet
Builtin-extended Boolean, lvarchar,  blob, clob Informix Dynamic Server Datatypes SET Complex Datatypes Basic SQL Types Numeric Character Time Large Objects Extended Data types User Defined Datatypes Collection Row Types Multi-Set List Distinct Opaque
Application IDS Server:  lenexa Database: geardb Table: winter_gear  with Boolean, lvarchar and distinct types C, SPL, Java functions IDS Server:  portland Database:geardb Table: rain_gear with Boolean, lvarchar, and distinct types C, SPL, Java functions IDS Server:  menlo Database: geardb Table: winter_gear  with Boolean, lvarchar and distinct types C, SPL, Java functions ISTAR: Distributed query connections SQL and result set exchange Multiple IDS server setup IDS Server:  toronto Database:geardb C, SPL, Java functions
Connect to  Menlo : CREATE TABLE sunny_gear(partner int, active Boolean, desc lvarchar(4096)); -- Select active partners at (Menlo, Lenexa and Portland) SELECT x.partner, x.desc, y.desc, z.desc FROM  geardb@menlo:sunny_gear x,  geardb@portland:rain_gear y,  geardb@lenexa:winter_gear z WHERE x.partner = y.partner and  x.partner = z.partner and x.active = ‘T’ and y.active = ‘T’ and z.active = ‘T’ ORDER BY x.partner;
Enhancements to distributed Explain. Explain file explains the query plan chosen by optimizer The explain file at co-ordinator provides the session ID at the sub-ordinator If the explain is ON at the co-ordinator, subordinator automatically generates the explain file. Can be disabled by DISTR_QUERY_FLAGS 0x01  enable or disable the distributed query plan 0x02  enable the statistics in the explain file. See the online.log for the exact location of the explain file.
On the coordinator QUERY: ------ SELECT rt1.col1 FROM orderby@server2:tab1 rt1 ORDER BY rt1.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 1) sqlqa.rt1: REMOTE PATH   Remote Server name: server2   Remote Session id: 6 Remote SQL Request:  select x0.col1 from orderby:"sqlqa".tab1 x0 order by x0.col2 On the subordinator: 09:19:34  Explain file for session 6 : usr/appusr1/sqexplain.out.6
Thank You [email_address] Session: 2988A

More Related Content

PDF
Indexing and Performance Tuning
PDF
Enable Database Service over HTTP or IBM WebSphere MQ in 15_minutes with IAS
PDF
Event Processing and Integration with IAS Data Processors
PDF
Introduction to Data Mining with R and Data Import/Export in R
PDF
Zero to Streaming: Spark and Cassandra
PPTX
Apache Spark Structured Streaming + Apache Kafka = ♡
PDF
Gur1009
PDF
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Indexing and Performance Tuning
Enable Database Service over HTTP or IBM WebSphere MQ in 15_minutes with IAS
Event Processing and Integration with IAS Data Processors
Introduction to Data Mining with R and Data Import/Export in R
Zero to Streaming: Spark and Cassandra
Apache Spark Structured Streaming + Apache Kafka = ♡
Gur1009
Apache Spark - Basics of RDD | Big Data Hadoop Spark Tutorial | CloudxLab

What's hot (19)

PPTX
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
PPTX
Session 04 pig - slides
PPTX
Sharding in MongoDB 4.2 #what_is_new
PPTX
Tk2323 lecture 9 api json
PDF
Why you should be using structured logs
PDF
Upgrading to MongoDB 4.0 from older versions
PDF
Securefile LOBs
PDF
How to upgrade to MongoDB 4.0 - Percona Europe 2018
PPT
ShmooCon 2009 - (Re)Playing(Blind)Sql
PPTX
Session 04 -Pig Continued
PDF
How to create a non managed standby database
PDF
PPT
Fast querying indexing for performance (4)
PPTX
Java Data Migration with Data Pipeline
PDF
Advanced Relevancy Ranking
PPTX
Postgresql Database Administration- Day4
PPTX
Postgresql Database Administration Basic - Day2
PDF
Indexing and Query Optimizer (Mongo Austin)
New Indexing and Aggregation Pipeline Capabilities in MongoDB 4.2
Session 04 pig - slides
Sharding in MongoDB 4.2 #what_is_new
Tk2323 lecture 9 api json
Why you should be using structured logs
Upgrading to MongoDB 4.0 from older versions
Securefile LOBs
How to upgrade to MongoDB 4.0 - Percona Europe 2018
ShmooCon 2009 - (Re)Playing(Blind)Sql
Session 04 -Pig Continued
How to create a non managed standby database
Fast querying indexing for performance (4)
Java Data Migration with Data Pipeline
Advanced Relevancy Ranking
Postgresql Database Administration- Day4
Postgresql Database Administration Basic - Day2
Indexing and Query Optimizer (Mongo Austin)
Ad

Viewers also liked (18)

PDF
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
PPTX
Decalogo del profesor de hoy.
PPTX
Muerte subita
PDF
Social Media: Critical Reflection (International Staff Week @ CUAS)
PDF
Médias sociaux: vers une approche stratégique
PPT
Safc Bioscience Raw Materials Initiative
PDF
amar o depender
PDF
Social Media and Protest Participation: Evidence from Russia
PDF
Shocked by therapy: employment patterns across the socioeconomic transition t...
PDF
Manual para no morir de Amor (Versión Corta)
PPTX
CES 2015: What a smarter world means for brands
PPTX
Microorganismos y alimentos
PPTX
Perubahan struktur ekonomi tugas ke 5-yusuf ulal abidin-12140027-5p ak
PPTX
Conferencia "Desarrollo de habilidades socioemocionales en el Marco del Progr...
PPTX
Uncertainty of oil price forecasts and macroeconomic implications
PPT
2 Racionalidad
PPT
Publicity
PPTX
Baltimore machine shop
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
Decalogo del profesor de hoy.
Muerte subita
Social Media: Critical Reflection (International Staff Week @ CUAS)
Médias sociaux: vers une approche stratégique
Safc Bioscience Raw Materials Initiative
amar o depender
Social Media and Protest Participation: Evidence from Russia
Shocked by therapy: employment patterns across the socioeconomic transition t...
Manual para no morir de Amor (Versión Corta)
CES 2015: What a smarter world means for brands
Microorganismos y alimentos
Perubahan struktur ekonomi tugas ke 5-yusuf ulal abidin-12140027-5p ak
Conferencia "Desarrollo de habilidades socioemocionales en el Marco del Progr...
Uncertainty of oil price forecasts and macroeconomic implications
2 Racionalidad
Publicity
Baltimore machine shop
Ad

Similar to Distributed Queries in IDS: New features. (20)

PPT
IBM Informix dynamic server 11 10 Cheetah Sql Features
PPTX
Modernizing Mission-Critical Apps with SQL Server
PPTX
Database Management System Review
DOC
Sql server
PPT
Sql server introduction to sql server
PPTX
Distributed query deep dive conor cunningham
PPT
MS SQL Server.ppt
PPT
dbs class 7.ppt
PPTX
OracleSQLraining.pptx
PDF
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
PDF
Postgresql 9.3 overview
PPTX
SQL (Basic to Intermediate Customized 8 Hours)
PDF
SQL tips and techniques April 2014
PPTX
Presentación Oracle Database Migración consideraciones 10g/11g/12c
PDF
The fillmore-group-aese-presentation-111810
PPT
Sql Server 2000
PPTX
Oracle database 12.2 new features
PPT
Slides_RDBMS_TBD_LC_02_Bridge course day 2
PDF
PDF
Database & Technology 1 _ Tom Kyte _ SQL Techniques.pdf
IBM Informix dynamic server 11 10 Cheetah Sql Features
Modernizing Mission-Critical Apps with SQL Server
Database Management System Review
Sql server
Sql server introduction to sql server
Distributed query deep dive conor cunningham
MS SQL Server.ppt
dbs class 7.ppt
OracleSQLraining.pptx
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Postgresql 9.3 overview
SQL (Basic to Intermediate Customized 8 Hours)
SQL tips and techniques April 2014
Presentación Oracle Database Migración consideraciones 10g/11g/12c
The fillmore-group-aese-presentation-111810
Sql Server 2000
Oracle database 12.2 new features
Slides_RDBMS_TBD_LC_02_Bridge course day 2
Database & Technology 1 _ Tom Kyte _ SQL Techniques.pdf

More from Keshav Murthy (20)

PDF
N1QL New Features in couchbase 7.0
PPTX
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
PPTX
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
PPTX
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
PDF
Couchbase 5.5: N1QL and Indexing features
PPTX
N1QL: Query Optimizer Improvements in Couchbase 5.0. By, Sitaram Vemulapalli
PPTX
Couchbase N1QL: Language & Architecture Overview.
PPTX
Couchbase Query Workbench Enhancements By Eben Haber
PPTX
Mindmap: Oracle to Couchbase for developers
PPTX
Couchbase N1QL: Index Advisor
PPTX
N1QL: What's new in Couchbase 5.0
PPTX
From SQL to NoSQL: Structured Querying for JSON
PPTX
Tuning for Performance: indexes & Queries
PPTX
Understanding N1QL Optimizer to Tune Queries
PPTX
Utilizing Arrays: Modeling, Querying and Indexing
PPTX
Extended JOIN in Couchbase Server 4.5
PPTX
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
PPTX
Query in Couchbase. N1QL: SQL for JSON
PPTX
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
PPTX
Introducing N1QL: New SQL Based Query Language for JSON
N1QL New Features in couchbase 7.0
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
Couchbase 5.5: N1QL and Indexing features
N1QL: Query Optimizer Improvements in Couchbase 5.0. By, Sitaram Vemulapalli
Couchbase N1QL: Language & Architecture Overview.
Couchbase Query Workbench Enhancements By Eben Haber
Mindmap: Oracle to Couchbase for developers
Couchbase N1QL: Index Advisor
N1QL: What's new in Couchbase 5.0
From SQL to NoSQL: Structured Querying for JSON
Tuning for Performance: indexes & Queries
Understanding N1QL Optimizer to Tune Queries
Utilizing Arrays: Modeling, Querying and Indexing
Extended JOIN in Couchbase Server 4.5
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Query in Couchbase. N1QL: SQL for JSON
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
Introducing N1QL: New SQL Based Query Language for JSON

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
sap open course for s4hana steps from ECC to s4
Encapsulation_ Review paper, used for researhc scholars
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools

Distributed Queries in IDS: New features.

  • 1. Distributed Queries in IDS: New features in IDS. Keshava Murthy, Architect, Informix Software. IBM, [email_address] Session Number 2988
  • 2. Introduction to distributed query Configuring IDS for distributed queries What’s new in IDS v10 and v11 Enhancements in IDS v10 Enhancements in IDS v11 Future directions and feedback
  • 3. inventorydb Application Application IDS Server: order_server IDS Server: eduserver Application orderdb payrolldb edudb CROSS-Database SELECT o.ordid, i.invdesc FROM orderdb:orders o , inventorydb:inventory i Where o.customerid = 1234 and o.ordinvid = i.invid; CROSS-Database SELECT p.empid, c.course FROM payrolldb:employees e, edudb:course c WHERE p.empid = 1234 And p.courseid = c.coursid
  • 4. inventorydb Application Application order_server orderdb emp_server empdb Application orderdb payrolldb edudb CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM payrolldb@emp_server:employees e, orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid
  • 5. Scenarios to use distributed queries. Need to access the latest data. Centralized control Data is in different systems – be in same or different location. Data can be in multiple version of IDS or XPS Data integration Heterogeneous data base systems.
  • 6. When to use distributed queries. Real time data access and modification. Reliable data access and modifications. Need full 2-phase commit support Used by the transaction manager at the co-ordinator Commit phase goes thru 2 phases 1 st phase: PREPARE to COMMIT 2 nd phase: commit if all the polled servers are OK.
  • 7. CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM payrolldb@emp_server:employees e, orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid inventorydb order_server:orderdb orderdb server2 server3 server5 server4
  • 8. sqlhosts Inventorysrv onsoctcp myinv.domaon.com 5463 orderserver onsoctcp 9.48.52.345 4526 Informix server name Network protocol IP address Port number
  • 9. QUERY: ------ SELECT t.col1 FROM orderby@server1:tab1 t ORDER BY t.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 Temporary Files Required For: Order By 1) sqlqa.t: SEQUENTIAL SCAN QUERY: ------ SELECT rt1.col1 FROM orderby@server2:tab1 rt1 ORDER BY rt1.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 1) sqlqa.rt1: REMOTE PATH Remote SQL Request: select x0.col1 from orderby:"sqlqa".tab1 x0 order by x0.col2
  • 10. QUERY: ------ select a1.t1c2, a2.t2c2, a3.t3c2, a4.t4c2 from (rdb2@server2:t1 a1 left join rdb2@server2:t2 a2 on a1.t1c1 = a2.t2c1) cross join (rdb2@server2:t3 a3 left join rdb2@server2:t4 a4 on a3.t3c1 = a4.t4c1) Estimated Cost: 7 Estimated # of Rows Returned: 11 1) sqlqa.a3, sqlqa.a4: REMOTE PATH Remote SQL Request: select x0.t3c1 ,x0.t3c2 ,x1.t4c1 ,x1.t4c2 from (rdb2:"sqlqa".t3 x0 left join rdb2:"sqlqa".t4 x1 on (x0.t3c1 = x1.t4c1 ) ) 2) sqlqa.a1, sqlqa.a2: REMOTE PATH Remote SQL Request: select x2.t1c1 ,x2.t1c2 ,x3.t2c1 ,x3.t2c2 from ((rdb2:"sqlqa".t1 x2 left join rdb2:"sqlqa".t2 x3 on (x2.t1c1 = x3.t2c1 ) )) NESTED LOOP JOIN
  • 11. Informix Dynamic Server Datatypes SET Complex Datatypes Basic SQL Types Numeric Character Time Large Objects Extended Data types Collection Row Types Multi-Set List Distinct Builtin-extended Boolean, lvarchar, blob, clob opaque User Defined Datatypes
  • 12. Built-in SQL Datatypes Character Numeric LargeObjects Time Char Varchar Nchar Nvarchar Int Int8 float Decimal Numeric Money Smallint Smallfloat Serial Serial8 Bigint Bigserial datetime Interval date Text Byte
  • 13. Built-in Extended types Boolean LVARCHAR BLOB CLOB
  • 14. Cross-Database Queries – one server IDS v10 and above New Extended Data types support Built-in UDTS across databases, single server instance BOOLEAN LVARCHAR BLOB CLOB Non built-in UDTS across databases in a single server instance, with explicit cast to LVARCHAR Boolean, LVARCHAR, BLOB and CLOB are commonly used in applications.
  • 15. Cross-Database Queries – one server IDS v10 and above New types can be used in Direct DML Views Synonyms Stored procedure parameters and return types C and Java UDRs
  • 16. Cross Database example: SELECT DATABASE orderdb; SELECT item_num,item_desc,item_specs,item_pic,item_life FROM inventorydb:itemtab WHERE item_num = 1; SELECT item_sm_pk::LVARCHAR,item_lg_pk::varchar FROM inventorydb:itemtab WHERE item_num = 2;
  • 17. Cross Database example: INSERT Insert on Remote table having built-in udts INSERT INTO remotedb:remtab (boolean_col, lvarchar_col, blob_col, clob_col) VALUES (‘t’, “lvarchar_data”, Filetoblob(‘blobfile’, ‘client’), Filetoclob(‘clobfile’, ‘client’)) Insert into remote table Select from local table built-in udts INSERT INTO remotedb:remtab ( boolean_col, lvarchar_col, blob_col, clob_col) SELECT bool_col, lvar_col, b_col, c_col FROM local_tab WHERE bool_col = “t”; Insert on Remote table non built-in UDTs INSERT INTO remotedb:remtab (udt1_col) SELECT udt_col::lvarchar FROM local_tab WHERE udt2_col::lvarchar = “ldata2row1”;
  • 18. Cross Database example: UPDATE/DELETE DATABASE orderdb; UPDATE inventorydb:itemtab SET (item_lg_pk) = ((SELECT order_lg_pk::lvarcharFROM ordertab WHERE order_sm_pk::lvarchar = "box(2,2,2,2)")) WHERE order_shelf_life = "t";
  • 19. Cross Database example: CREATE VIEW DATABASE orderdb; CREATE VIEW item_pk_view AS SELECT item_lg_pk::lvarchar, item_sm_pk::varchar FROM inventorydb:itemtab WHERE item_sm_pk::char matches "box(2,2,2,2)*"
  • 20. CROSS-SERVER SELECT p.empid, o.orderid, o.orderdesc FROM payrolldb@emp_server:employees e, orderdb@order_server:course c WHERE e.empid = 1234 And e.courseid = c.coursid Cross Server inventorydb order_server:orderdb orderdb server2 server3 server5 server4
  • 21. Enhancements in IDS v11.10 Cross-Server queries now support Boolean Lvarchar Distinct types of Boolean and Lvarchar Distinct types of built-in SQL types Numeric (int, decimal, etc) character (char, varchar, etc) Time (datetime) No support for blob and clob yet
  • 22. Builtin-extended Boolean, lvarchar, blob, clob Informix Dynamic Server Datatypes SET Complex Datatypes Basic SQL Types Numeric Character Time Large Objects Extended Data types User Defined Datatypes Collection Row Types Multi-Set List Distinct Opaque
  • 23. Application IDS Server: lenexa Database: geardb Table: winter_gear with Boolean, lvarchar and distinct types C, SPL, Java functions IDS Server: portland Database:geardb Table: rain_gear with Boolean, lvarchar, and distinct types C, SPL, Java functions IDS Server: menlo Database: geardb Table: winter_gear with Boolean, lvarchar and distinct types C, SPL, Java functions ISTAR: Distributed query connections SQL and result set exchange Multiple IDS server setup IDS Server: toronto Database:geardb C, SPL, Java functions
  • 24. Connect to Menlo : CREATE TABLE sunny_gear(partner int, active Boolean, desc lvarchar(4096)); -- Select active partners at (Menlo, Lenexa and Portland) SELECT x.partner, x.desc, y.desc, z.desc FROM geardb@menlo:sunny_gear x, geardb@portland:rain_gear y, geardb@lenexa:winter_gear z WHERE x.partner = y.partner and x.partner = z.partner and x.active = ‘T’ and y.active = ‘T’ and z.active = ‘T’ ORDER BY x.partner;
  • 25. Enhancements to distributed Explain. Explain file explains the query plan chosen by optimizer The explain file at co-ordinator provides the session ID at the sub-ordinator If the explain is ON at the co-ordinator, subordinator automatically generates the explain file. Can be disabled by DISTR_QUERY_FLAGS 0x01 enable or disable the distributed query plan 0x02 enable the statistics in the explain file. See the online.log for the exact location of the explain file.
  • 26. On the coordinator QUERY: ------ SELECT rt1.col1 FROM orderby@server2:tab1 rt1 ORDER BY rt1.col2 Estimated Cost: 1 Estimated # of Rows Returned: 1 1) sqlqa.rt1: REMOTE PATH Remote Server name: server2 Remote Session id: 6 Remote SQL Request: select x0.col1 from orderby:"sqlqa".tab1 x0 order by x0.col2 On the subordinator: 09:19:34 Explain file for session 6 : usr/appusr1/sqexplain.out.6
  • 27. Thank You [email_address] Session: 2988A