Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
добрый день подскажите: в iSeries (v5r3, v6r1) примари кей не является индексом ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.02.2013, 12:55 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_Andдобрый день подскажите: в iSeries (v5r3, v6r1) примари кей не является индексом ? Забыл добавить - для вызова хранимым процедур, через JDBC ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.02.2013, 13:43 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_Andподскажите: в iSeries (v5r3, v6r1) примари кей не является индексом ? Здравствуйте. Constraints : Unique constraints are implemented with indexes ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.02.2013, 14:16 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
добрый день Mark Barinstein Как бы на LUW DB2 - да но на iSeries аккурат мы сталкнулись с проблемой: есть таблица - есть примари кей - строиться процедура, выполняющая некий расчет она может работать 2.5 часа строим индекс с полями идентичными примари, перестраиваем процедуру - работает 2 мин Было высказано предположение, что ПК юзаются для RPG програм запущенных с консоли Мы же используем ODBC/JDBC соединение и просто вызов хранимых процедур Возможно в этом ньюанс. Возможно причина в другом Буду рад любой помощи Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.02.2013, 16:11 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, индекс - отдельный объект = Logical File -содержит только поля ключа, наверно просто намного короче строка. Используете таблицу в регулярной библиотеке или в SQL-collection? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2013, 13:52 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
knudsen, Используем таблицу в SQL процедурах, причем как для инсертов-апдэйтов, так и для курсора отдовая данные наружу. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.02.2013, 08:10 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, SQL-collection = SCHEMA когда создаётся схема - там по умолчанию есть журналирование всех SQL-ей, А если командой CRTLIB ... то шиш.. надо параметры указывать всяческие... по ссылке от Марка (выше) можно посмотреть. А вот когда создаёшь таблицу и индех (например с промта = SQLSTR), то получается следующее: 1. Enter SQL Statements Type SQL statement, press Enter. > CREATE TABLE TABLENM ( A1 INTEGER NOT NULL, A2 INTEGER, A3 CHAR(128), PRIMARY KEY (A1)) Table TABLENM in TESTLIB1 created but could not be journaled. ===> 2. CREATE UNIQUE INDEX TABLENML ON TABLENM(A1) Index TABLENML created in TESTLIB1 on table TABLENM in TESTLIB1. ===> 3. Запишем 10 записей (просто так) получаются два объекта: Work with Objects Using PDM TECL1 Library . . . . . TESTLIB1 Position to . . . . . . . . Position to type . . . . . Opt Object Type Attribute Text TABLENM *FILE PF-DTA TABLENML *FILE LF PF-DTA: Storage information: Size . . . . . . . . . . . . . . . : 192512 LF: Storage information: Size . . . . . . . . . . . . . . . : 12288 ,причём в PF - первичный ключ в самом объекте... Access Path Description Access path maintenance . . . . . . . . . . : MAINT *IMMED Unique key values required . . . . . . . . : UNIQUE Yes Access path journaled . . . . . . . . . . . : No Access path . . . . . . . . . . . . . . . . : Keyed Constraint Type . . . . . . . . . . . . . . : PRIMARY Number of key fields . . . . . . . . . . . : 1 Record format . . . . . . . . . . . . . . . : TABLENM Key field . . . . . . . . . . . . . . . . : A1 Sequence . . . . . . . . . . . . . . . : Ascending Sign specified . . . . . . . . . . . . : SIGNED Zone/digit specified . . . . . . . . . : *NONE Alternative collating sequence . . . . : No Sort Sequence . . . . . . . . . . . . . . . : SRTSEQ *HEX ..... Constraint Description Primary Key Constraint Constraint . . . . . . . . . . . . . . : CST Q_TESTLIB1_TABLEN Type . . . . . . . . . . . . . . . . : TYPE *PRIMARY Key . . . . . . . . . . . . . . . . . : KEY A1 Number of fields in key . . . . . . . : 1 Key length . . . . . . . . . . . . . : 4 ..... Display Spooled File File . . . . . : QPDSPFD Page/Line 3/18 Control . . . . . Columns 1 - 78 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+... Partial transaction exists, roll back ended . . . . . . . . . . . . : *NO Starting journal receiver for apply . . . : Library . . . . . . . . . . . . . . . . : ASP Device . . . . . . . . . . . . . . : Constraint access path attributes . . . . : Constraint . . . . . . . . . . . . . . : CST Q_TESTLIB1_TABLEN Access path recovery . . . . . . . . : *IPL Forced key access path . . . . . . . : *NO Key must be unique . . . . . . . . . : *YES Access path journaled . . . . . . . . : *NO Access path valid . . . . . . . . . . : *YES Number of access path entries . . . . : 10 Access path size . . . . . . . . . . : 139264 Access path logical reads . . . . . . : Access path physical reads . . . . . : More... F3=Exit F12=Cancel F19=Left F20=Right F24=More keys ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.02.2013, 17:39 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, а может быть ещё статистику... типа, собрать... и всякое такое... Но мне нравиться отдельно логические файлики строить, а там можно ещё и не все поля из PF брать и форматики всякие..., а iSeries сама может определить по какому LF шагать... нет, конечно, можно и нужно помогать ей в этом... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.02.2013, 17:45 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
knudsen, спасибо, за такое подробное описание - про логические и физические файлы уже в курсе в зеленые экраны до последнего времени вообще не лазили - создавали схемы из навигатора с журналированием а вопрос - как на iSeriese собрать статистику ? RUNSTATS ON TABLE NAME_TBL ON ALL COLUMNS WITH DISTRIBUTION ON ALL COLUMNS AND DETAILED INDEXES ALL ALLOW WRITE ACCESS SQL1651N The request cannot be executed because the DB2 server version does not support this functionality. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 10:53 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
knudsen, и еще вопрос - а есть ли REBIND в iSeries спасибо )) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 11:02 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
И контрольный ... Эксплэйн запросов есть в том же навигаторе а вот есть ли эксплэйн SQL процедур ? Спасибо... )) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 11:06 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, На счёт статистики - не надо ничего делать :) (каюсь - забыл, давно не работал.... может чего и поменялось...) цитирую DB2 ® SQL PL, Second Edition: Deployment and Advanced Configuration Essential Guide for DB2 ® UDB on Linux., UNIX™, Windows ® , i5/OS™, z/OS ® By Zamil Janmohamed, Clara Liu, Drew Bradstock, Raul Chong, Michael Gao, Fraser McArthur, Paul Yip Publisher : Prentice Hall PTR Pub Date : November 15, 2004 ISBN : 0-13-147700-5 ...... Database Statistics Database table, column, and index statistics are vital to generating the most efficient query access plans. The Statistics Manager is tasked with collecting and keeping the statistics up to date. It keeps track of the following information: Cardinality of column values Selectivity (distribution of values in a column) Frequent values (top values in a column and associated frequency) Metadata information on a table (number of rows and indexes) Estimate of I/O operation (for access to table or index) The information is collected automatically, but updates to statistical information are not immediate, with the exception of indexes. Statistics on indexes are updated as changes occur. For other objects such as tables or columns, collection occurs in the background as system resources become available. Because index statistics are immediately updated, they act as the primary source of statistical information for the DB2 UDB iSeries optimizer. One of the biggest causes of poor performance on iSeries is the absence of the correct indexes. When the Statistics Manager receives requests from the query optimizer, estimates for column statistics are returned, regardless of whether the statistics have been collected. If a request for a column with no statistical data is received, a default value is returned and the column is marked for collection. The next time collection starts, statistics for that column will be collected. To determine when to re-calculate statistics after they have been collected, the Statistics Manager relies on the Plan Cache. Recall from Chapter 7, "Working with Dynamic SQL," that the plan cache is an area in memory where generated access plans are stored. Each time a new access plan is created or an existing plan is re-used, the Statistics Manager will validate to see if more than 15 percent of the data in the underlying table(s) has changed. If it has, then the corresponding columns will be marked for collection. Additionally, the access plan will also be marked so the next time it is accessed, a new plan is generated. The automation of the collection works well; however, there are cases when you may want to force the collection of statisticsfor example, if you've completed some mass updates or added large volumes of data. You have two options available to you for forcing the collection of statistics. You can use the IBM iSeries Navigator to select tables and columns for which to collect statistics, or you can do it programmatically through the use of APIs. Note If your system resources are busy for long periods of time, statistics collection will not occur because the Statistics Manager waits for system resources to become available. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 12:45 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, Надеюсь, вы не хранилище там строите? через "зелёненький" экранчик-то побыстрее работают некоторые вещи... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 13:04 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, db2rbind <dbname> -l <logfile.out> ALL .... - из командной строки DB2-Connect, что-то подобное делал, и там права нужны на библиотеку NULLID .... кажется... , ах ну и старый добрый "Ассистент конфигурирования" . ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 13:33 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
knudsen, На хранилище это возможно и похоже, но только если судить по объемам данных Спасибо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.02.2013, 14:48 |
|
||
|
Primary Key и Index в iSeries
|
|||
|---|---|---|---|
|
#18+
Wiseman_And, А процедурки на RPG писать не пробовали... занятненько получается..., да и побыстрее порой. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.02.2013, 14:01 |
|
||
|
|

start [/forum/topic.php?fid=43&msg=38157797&tid=1601525]: |
0ms |
get settings: |
9ms |
get forum list: |
13ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
46ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
43ms |
get tp. blocked users: |
1ms |
| others: | 260ms |
| total: | 387ms |

| 0 / 0 |
