Actions

Difference between revisions of "Informix"

From kemiko

 
(33 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[https://en.wikipedia.org/wiki/IBM_Informix IBM Informix]
 
[https://en.wikipedia.org/wiki/IBM_Informix IBM Informix]
  
This wiki article says, "Informix is generally considered to be optimized for environments with very low or no database administration, including use as an embedded database. It has a long track record of supporting very high transaction rates and providing uptime characteristics needed for mission critical applications such as manufacturing lines and reservation systems. Informix has been widely deployed in the retail sector, where the low administration overhead makes it useful for in-store deployments." I have worked with Informix in both manufacturing and reservations.
+
This wiki article says, "Informix is generally considered to be optimized for environments with very low or no database administration, including use as an embedded database. It has a long track record of supporting very high transaction rates and providing uptime characteristics needed for mission critical applications such as manufacturing lines and reservation systems. Informix has been widely deployed in the retail sector, where the low administration overhead makes it useful for in-store deployments."
  
  
I am currently working with Informix 9.40.FC7 as an adminisrator not a developer
+
I have worked with Informix in a very large reservation system, insurance and manufacturing. I find the above statement very true.
  
*onstat commands are predefined queries that pull from the shared memory, sysmaster database, system files, etc.  They are not output in the best format for reading or joining with other data...so use the sysmaster database to create your own reports with SQL joins
 
*Learn the sysmaster database...this database holds statistics and configurations
 
*ESQL/C is very fast for accessing the database
 
*dbacces (output is vertical if width if greater than 80 characters) and isql are horrible interfaces
 
*Every database has system tables that hold table, column, index information, etc.  (select tabname from systables where tabid <= 100)
 
*Raw devices are faster
 
*optimize your statistics plan
 
*HPL (High Performance Loader) is a very awkward tool, but can unload and reload tables quicker using a raw data format
 
*Create enough space for logical logging to prevent downtime if the tape fails.  The engine will stop running if these logs can't be backed up
 
*Inserts into a large tables can really slow down OLTP databases
 
*A "dummy" archive, ontape -s -L 0...w/TAPEDEV set to /dev/null, must be done after some configuration changes
 
*Our Informix 9.40.FC7, which is 64 bit, has a 2GiB file limitation writing to HP-UX 11.11's file system...not the actual database data files
 
*The system log only stamps the log with date when the first record of the day is written...then most records only have a time stamp
 
*Try and size your table large enough that you don't have a lot of additional extents
 
*I really like some of Informix's SQL extensions...like "||" for concatenation, field[n,m] for substring, field matches( regex ), etc.
 
*Informix date and time fields are very different from MySQL
 
  
I have the most experience with MySQL....so, what are the differences between Informix and MySQL?
+
I am currently working with <font color="red"><b>Informix 9.40.FC7</b></font> on HP-UX 11.11 as mostly an adminisrator not a developer.  I recently added an <font color="red"><b>Informix 12.10.FC7WE</b></font> replicated server on RHEL 7.3.  I started with <font color="red"><b>MySQL 3.23</b></font> on Linux and <font color="red"><b>Informix C-ISAM</b></font> on DEC Ultrix (pre IBM).
 +
 
 +
*onstat commands are predefined queries that pull from the shared memory, sysmaster database, system files, etc.&nbsp;&nbsp;They are not output in the best format for reading or joining with other data...so use the sysmaster database to create your own reports with SQL joins&nbsp;&nbsp;([[Informix Monitoring]])
 +
*Learn the sysmaster database...this database holds configurations and statistics
 +
*ESQL/C is very fast for accessing the database.  I used it to create session monitoring tool (itop) which is like *nix "top" or MySQL "mytop"
 +
*dbacces (output is vertical if width if greater than 80 characters) and isql are horrible SQL clients...use something like open source [http://squirrel-sql.sourceforge.net/ SQuirreL] for most queries.  But, if you want to query table between Informix servers you have to use Informix tools like dbacces and isql.
 +
*Every database has catalog tables that hold table, column, index information, etc.  (select tabname from systables where tabid < 100;)
 +
*Find columns with SQL...SELECT tabname, syscolumns.* FROM systables, syscolumns WHERE systables.tabid = syscolumns.tabid AND tabname = 'table'; or with ANSI join SELECT t.tabname, c.* FROM systables t JOIN syscolumns c ON t.tabid = c.tabid;
 +
*Raw devices are faster which Informix uses very well
 +
*Optimize your statistics plan for better performance
 +
*HPL (High Performance Loader) is a very awkward GUI tool, but can unload and reload tables quicker using a raw data format
 +
*Create enough space for logical logging to prevent downtime if the tape fails.  The engine will block transaction if these logs can't be backed up
 +
*Large tables can really slow down OLTP databases.  So, archive tables that are OLTP.
 +
*A "dummy" archive, ontape -s -L 0...w/TAPEDEV set to /dev/null (in onconfig), must be done after some configuration changes
 +
*Our Informix 9.40.FC7, which is 64 bit, has a 2GiB file limitation writing to HP-UX 11.11's file system...not the actual database data files going to a tape or pipe.  So 9.40 can not archive a large database to disk without going to tape or through a pipe.  12.10 does not have this issue.
 +
*The system log only stamps the log with the date when the first record of the day is written...then only a time stamp is on the records.&nbsp;&nbsp;In 12.10 set "MSG_DATE 1" in the onconfig file to get the date stamp on each record.
 +
*Try and size your initial extents large enough that the engine does not have to keep creating more extents.  Multiple extents fragment your table spaces.
 +
*Informix date and time fields/functions are very different from MySQL
 +
*I really like some of Informix's SQL extensions...like "||" for concatenation, field[n,m] for substring, field matches( regexp ), first, etc.
 +
*Don't hit ctrl-c while starting the database (command oninit)...this will leave share memory in limbo
 +
*Informix can do queries between 2 servers.&nbsp;&nbsp;Use lowercase strings for DBSERVERNAME and DBSERVERALIASES values
 +
*Do not OS "nice" dbaccess, etc.  The engine handles the priority.  Set MAX_PDQPRIORITY (Parallel Database Query) to process queries faster.
 +
*Informix is closely tied to the OS.  Users and passwords are created and maintained by the OS.
 +
*Informix privileges are definitely different from MySQL.  Informix has a "connect" grant that I like because it is the only privilges you need to revoke to deny a user access make other grants void!  Also, Informix can list "all" grants in one statement...MySQL can not!
 +
*<font color="red">Informix 12.10 has a single user mode...does MySQL? (read_only=1)</font>
 +
*Informix has had descending btree indexes since 9.40, but MySQL will not have them until 8.0.
 +
*Informix "CURRENT" operator vs MySQL NOW() function.
 +
*Informix &lt;database&gt;<font color="red"><b>:</b></font>&lt;table&gt;...MySQL &lt;database&gt;<font color="red"><b>.</b></font>&lt;table&gt;
 +
*Informix 9.40 did not have a "truncate" command!
 +
 
 +
 
 +
What are the differences between SQL statements with Informix and MySQL?&nbsp;&nbsp;(<font color="green">positive</font>/<font color="red">negative</font>/<font color="orange">neutral</font>)
 
<table>
 
<table>
 +
<tr>
 +
  <td>
 +
  Informix
 +
  </td>
 +
  <td>
 +
  MySQL
 +
  </td>
 +
</tr>
 
<tr>
 
<tr>
  <td>
+
  <td>
   Informix
+
  <font color="orange"><b>database</b></font> database;
 +
  </td>
 +
  <td>
 +
  <font color="orange"><b>use</b></font> database;
 +
  </td>
 +
</tr>
 +
  <tr>
 +
  <td>
 +
  comments are: "<font color="orange"><b>{</b></font>" comment(s) "<font color="orange"><b>}</b></font>" or "<font color="orange"><b>--</b></font>"
 +
  </td>
 +
   <td>
 +
  coments are: "<font color="orange"><b>/*</b></font>" comment(s) "<font color="orange"><b>*/</b></font>" or "<font color="orange"><b>--</b></font>"
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  <font color="red">A table NEEDS to be included in ALL select statements</font>
 +
  </td>
 +
  <td>
 +
  <font color="green">A table DOES NOT NEED to be included in select statements</font>
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT <i><b>'select_expr'</b></i> <font color="green"><b>MATCHES</b></font> <i><b>'regular_expr'</b></i> FROM <i><b>table</b></i>;
 
   </td>
 
   </td>
  <td>
+
  <td>
   MySQL
+
  SELECT <i><b>'select_expr'</b></i> <font color="red"><b>REGEXP</b></font> <i><b>'regular_expr'</b></i>;
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT <i><b>'select_expr'</b></i> <font color="green"><b>||</b></font> <i><b>'select_expr'</b></i> FROM <i><b>table</b></i>;
 +
  </td>
 +
  <td>
 +
  SELECT <font color="red">CONCAT(</font> <i><b>'select_expr'</b></i>, <i><b>'select_expr'</b></i> <font color="red">)</font>;
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT <font color="red">FIRST i</font> <i><b>'select_expr'</b></i> FROM <i><b>table</b></i>;
 +
  <font color="blue"><b>--OR</b></font>
 +
  SELECT <i><b>'select_expr'</b></i> FROM <i><b>table</b></i> <font color="green">LIMIT i</font>;  {Informix version 12}
 +
  </td>
 +
  <td>
 +
  SELECT <i><b>'select_expr'</b></i> <font color="green">LIMIT i</font>;
 +
  </td>
 +
  </tr>
 +
<tr>
 +
  <td>
 +
  SELECT <i><b>'select_expr'</b></i> FROM <font color="red"><i><b>table</b></i> WHERE 1 = 1</font>;
 +
  </td>
 +
  <td>
 +
  SELECT <i><b>'select_expr'</b></i> <font color="green">WHERE 1</font>;
 +
  </td>
 +
</tr>
 +
<tr>
 +
   <td>
 +
  SELECT <i><b>'select_expr'<font color="green">[i,j]</font></b></i> FROM <i><b>table</b></i> 1 = 1;
 +
  </td>
 +
  <td>
 +
  SELECT <font color="red">SUBSTR(</font> <i><b>'select_expr', <font color="red">i, j )</font> </b></i>WHERE 1;
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT <font color="red">CURRENT</font> FROM <i><b>systables</b></i> WHERE <i><b>tabid = 1</b></i>;
 +
  </td>
 +
  <td>
 +
  SELECT <font color="green">NOW( )</font>;
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT * FROM <i><b>database</b></i><font color="orange"><b>:</b></font><i><b>table</b></i>;
 +
  </td>
 +
  <td>
 +
  SELECT * FROM <i><b>database</b></i><font color="orange"><b>.</b></font><i><b>table</b></i>;
 +
  </td>
 +
</tr>
 +
<tr>
 +
  <td>
 +
  SELECT <i><b>database</b></i>:systables.tabname, <i><b>database</b></i>:syscolumns.*
 +
  FROM <i><b>database</b></i>:systables
 +
  JOIN <i><b>database</b></i>:syscolumns
 +
  ON <i><b>database</b></i>:systables.tabid = <i><b>database</b></i>:syscolumns.tabid
 +
  WHERE <i><b>database</b></i>:systables.tabname = '<i><b>table</b></i>';
 +
  </td>
 +
  <td>
 +
  SELECT *
 +
  FROM information_schema.columns
 +
  WHERE table_schema = '<i><b>database</b></i>' AND table_name = '<i><b>table</b></i>';
 +
  <font color="blue"><b>--OR</b></font>
 +
  <font color="green">DESCRIBE <i><b>database</b></i>.<i><b>table</b></i>;</font>
 
   </td>
 
   </td>
 
  </tr>
 
  </tr>
 
</table>
 
</table>
 +
 +
 +
[http://www.iiug.org/en/2017/07/29/compare-informix/ Compare the Informix Version 12 editions]
 +
 +
 +
<b>Informix NOTs</b>
 +
 +
-case sensitive
 +
 +
-can't have spaces in AS

Latest revision as of 08:26, 6 March 2018

IBM Informix

This wiki article says, "Informix is generally considered to be optimized for environments with very low or no database administration, including use as an embedded database. It has a long track record of supporting very high transaction rates and providing uptime characteristics needed for mission critical applications such as manufacturing lines and reservation systems. Informix has been widely deployed in the retail sector, where the low administration overhead makes it useful for in-store deployments."


I have worked with Informix in a very large reservation system, insurance and manufacturing. I find the above statement very true.


I am currently working with Informix 9.40.FC7 on HP-UX 11.11 as mostly an adminisrator not a developer. I recently added an Informix 12.10.FC7WE replicated server on RHEL 7.3. I started with MySQL 3.23 on Linux and Informix C-ISAM on DEC Ultrix (pre IBM).

  • onstat commands are predefined queries that pull from the shared memory, sysmaster database, system files, etc.  They are not output in the best format for reading or joining with other data...so use the sysmaster database to create your own reports with SQL joins  (Informix Monitoring)
  • Learn the sysmaster database...this database holds configurations and statistics
  • ESQL/C is very fast for accessing the database. I used it to create session monitoring tool (itop) which is like *nix "top" or MySQL "mytop"
  • dbacces (output is vertical if width if greater than 80 characters) and isql are horrible SQL clients...use something like open source SQuirreL for most queries. But, if you want to query table between Informix servers you have to use Informix tools like dbacces and isql.
  • Every database has catalog tables that hold table, column, index information, etc. (select tabname from systables where tabid < 100;)
  • Find columns with SQL...SELECT tabname, syscolumns.* FROM systables, syscolumns WHERE systables.tabid = syscolumns.tabid AND tabname = 'table'; or with ANSI join SELECT t.tabname, c.* FROM systables t JOIN syscolumns c ON t.tabid = c.tabid;
  • Raw devices are faster which Informix uses very well
  • Optimize your statistics plan for better performance
  • HPL (High Performance Loader) is a very awkward GUI tool, but can unload and reload tables quicker using a raw data format
  • Create enough space for logical logging to prevent downtime if the tape fails. The engine will block transaction if these logs can't be backed up
  • Large tables can really slow down OLTP databases. So, archive tables that are OLTP.
  • A "dummy" archive, ontape -s -L 0...w/TAPEDEV set to /dev/null (in onconfig), must be done after some configuration changes
  • Our Informix 9.40.FC7, which is 64 bit, has a 2GiB file limitation writing to HP-UX 11.11's file system...not the actual database data files going to a tape or pipe. So 9.40 can not archive a large database to disk without going to tape or through a pipe. 12.10 does not have this issue.
  • The system log only stamps the log with the date when the first record of the day is written...then only a time stamp is on the records.  In 12.10 set "MSG_DATE 1" in the onconfig file to get the date stamp on each record.
  • Try and size your initial extents large enough that the engine does not have to keep creating more extents. Multiple extents fragment your table spaces.
  • Informix date and time fields/functions are very different from MySQL
  • I really like some of Informix's SQL extensions...like "||" for concatenation, field[n,m] for substring, field matches( regexp ), first, etc.
  • Don't hit ctrl-c while starting the database (command oninit)...this will leave share memory in limbo
  • Informix can do queries between 2 servers.  Use lowercase strings for DBSERVERNAME and DBSERVERALIASES values
  • Do not OS "nice" dbaccess, etc. The engine handles the priority. Set MAX_PDQPRIORITY (Parallel Database Query) to process queries faster.
  • Informix is closely tied to the OS. Users and passwords are created and maintained by the OS.
  • Informix privileges are definitely different from MySQL. Informix has a "connect" grant that I like because it is the only privilges you need to revoke to deny a user access make other grants void! Also, Informix can list "all" grants in one statement...MySQL can not!
  • Informix 12.10 has a single user mode...does MySQL? (read_only=1)
  • Informix has had descending btree indexes since 9.40, but MySQL will not have them until 8.0.
  • Informix "CURRENT" operator vs MySQL NOW() function.
  • Informix <database>:<table>...MySQL <database>.<table>
  • Informix 9.40 did not have a "truncate" command!


What are the differences between SQL statements with Informix and MySQL?  (positive/negative/neutral)

  Informix
  MySQL
  database database;
  use database;
  comments are: "{" comment(s) "}" or "--"
  coments are: "/*" comment(s) "*/" or "--"
  A table NEEDS to be included in ALL select statements
  A table DOES NOT NEED to be included in select statements
  SELECT 'select_expr' MATCHES 'regular_expr' FROM table;
  SELECT 'select_expr' REGEXP 'regular_expr';
  SELECT 'select_expr' || 'select_expr' FROM table;
  SELECT CONCAT( 'select_expr', 'select_expr' );
  SELECT FIRST i 'select_expr' FROM table;
  --OR
  SELECT 'select_expr' FROM table LIMIT i;  {Informix version 12}
  SELECT 'select_expr' LIMIT i;
  SELECT 'select_expr' FROM table WHERE 1 = 1;
  SELECT 'select_expr' WHERE 1;
  SELECT 'select_expr'[i,j] FROM table 1 = 1;
  SELECT SUBSTR( 'select_expr', i, j ) WHERE 1;
  SELECT CURRENT FROM systables WHERE tabid = 1;
  SELECT NOW( );
  SELECT * FROM database:table;
  SELECT * FROM database.table;
  SELECT database:systables.tabname, database:syscolumns.*
  FROM database:systables
  JOIN database:syscolumns
  ON database:systables.tabid = database:syscolumns.tabid
  WHERE database:systables.tabname = 'table';
  SELECT * 
  FROM information_schema.columns
  WHERE table_schema = 'database' AND table_name = 'table';
  --OR
  DESCRIBE database.table;


Compare the Informix Version 12 editions


Informix NOTs

-case sensitive

-can't have spaces in AS