Ognacの雑感

木漏れ日々

目次

Blog 利用状況

書庫

ギャラリ

今時の組織はSQL不向き?

一昔前の組織構造はヒエラルキーの構造をしていて、命令系統は上意下達で、稟議・報告系統は下意上達なのでシンプルでした。
RDBでのデータ設計も、部品の構成体系と類似の仕組みが流用できて扱い易かったです。
部品の構成関係の子部品展開などと同様に、再帰的に展開すればよいし、ツリー構造が成立しているので言語でロジックを組んでも便利でした。

最近の組織は、複数の部署を一人が面倒みたり、一人の従業員が複数の部署に所属したり、勤務命令の系統と、仕事命令の系統が別だったり、複数のプロジェクトに所属すると、上司が複数存在することになるそうです。
学校の担任も、一つのクラスに複数の担任がいたり、そのうちの一人は、複数のクラスの担任だったりします。
従来の組織の仕組みが使えません。
 一人の上司が複数存在すると、 固定SQLで処理するには、副問い合わせするか、、上位部署を複数保持するList型にして言語処理するなどの対応になります。
双方向リストをデーブルに実装すれば、追跡処理は可能になります。
 でも、このような階層構造の過去蓄積は少ないらしく、試行錯誤で設計しているプロジェクトもあるようです。
「サンプルがないから、できません」....などと脳天気なことを言ってくる開発者もいるようで....これは棚に上げるとして...いつ下ろすかは問題ですが。

DataBaseの教科書には、「n:n は n:1 と1:n に帰結できる。1:nを押さえれば レコード設計はできる」とあるようですが、(そのように習ったそうです。)
上司が複数の部下を持ち、その部下は複数の上司を持つという、構造では、単純なn:1..1:n の図式に該当するような、しないような....。ツリー構造とは言いませんよね。
上司が複数、部下も複数ということは、家系図に相当しそうですね。家系図構造と言った方が近いかな。
家系図はRDBで一意に設計できるのだろうか。RDB的には向いてないように思うのです。

自分の 部下が複数いるときは、 where  上位者 = 私  で n件引っ張れますが、
自分の上司が複数いるときは、   where  code in  (select 上位者 where  code=私) とでもしましょうか。
でも同時に取得しようとしたら......できないようなできるような...orz;
今後も、もっと複雑なパターンが登場するのでしょうね。

少し話がずれるのですが。
SQLはヒエラルキー型であっても、なくても select文の要素は事前に確定していることが 条件なので
 select 部下1,部下2,部下3,,,,,  from  Table  where code=私
 select 上位者1,上位者2,上位者3,,,,,  from  Table  where code=私
などと、要素が複数あるときは、チト困ります。 言語でLOOP回しするのが安易ですが、SQL内でSQLを生成する動的SQLも一つの方法ですね。
言語の受け持ち範囲と、SQLの受け持ち範囲の境界線の設定も、プロジェクト開発効率の大きな要素だと思います。

投稿日時 : 2009年9月23日 0:22

Feedback

# re: 今時の組織はSQL不向き? 2009/09/23 1:15 THREE-ONE

別に今時の組織が SQL に不向きなのではなく、「一発の SQL でこなす」っていうのが今の時代に即していないんだと思います。

# re: 今時の組織はSQL不向き? 2009/09/23 13:06 こあら

「ソートのロジックは勉強したけど、実際には Array.Sort しか使ったことが無い。」
という人ってどのくらい居るのでしょうかね?
まぁ私のことなのですが。
時代的には「何でも一発でこなす」方向の気がします。

オブジェクトDBとか?「双方向リストをテーブルに実装」のような
裏方作業は、できることなら機械に任せてしまいたいです。

# re: 今時の組織はSQL不向き? 2009/09/23 18:56 ognac

>「一発の SQL でこなす」っていうのが今の時代に即していないんだと思います。
確かにその通りですね。 RDBで表現できる範囲って、見方を変えれば、範囲が限定されそうな気がします。
Object RDBがどこまで対応できるのでしょうかね。

>裏方作業は、できることなら機械に任せてしまいたいです。
List追跡くらいは、して欲しい所ですね。でも表現か難しそう。

# write narrative essay g20rhs 2022/09/04 12:50 Charlosmox


Thanks, Plenty of forum posts.
https://definitionessays.com/ the thesis statement usually appears in the

# essay writing x41ygh 2022/09/08 18:12 Charlosmox


Whoa a good deal of valuable information. https://definitionessays.com/ how to write an essay on a movie

# i need a ghostwriter v73pzc 2023/02/09 8:59 Albertosed


Kudos. Useful stuff!

https://service-essay.com/ argument essay help

# buying essay a53ugw 2023/02/26 12:43 CharlesSnoff


Thanks! A good amount of knowledge!
where can i buy essay https://quality-essays.com/ can i pay someone to write my essay

# top 10 dissertation writing services h95hwc 2023/02/27 3:09 Robertsaids


Thanks a lot, An abundance of content.
buy a research proposal https://dissertationwritingtops.com/ dissertation editing service

# top 10 research paper writing service k780qg 2023/03/01 2:19 StevenGrelo

You reported that fantastically!
cheapest paper writing service https://service-essay.com/ best paper writing service 2018 reddit

# quality custom essays x65xio 2023/03/06 6:17 EugeneSib


Amazing write ups. Thanks.
exemplary college essays https://writeadissertation.com accounting dissertation https://writingpaperforme.com

# cheap writing services q44quo 2023/03/06 15:46 Gregorysaipt


Really a good deal of amazing material.
successful college essays https://phdthesisdissertation.com writing an argumentative essay powerpoint https://helptowriteanessay.com

# how to write an autobiographical essay w73loq 2023/03/07 12:17 EugeneSib


Thanks a lot, Quite a lot of material!
dissertation service writing https://domycollegehomeworkforme.com writing an expository essay https://homeworkcourseworkhelps.com

# custom written dissertations g67txy 2023/03/07 14:19 Gregorysaipt


Cheers! Fantastic information.
online help with essay writing https://service-essay.com how to write a essay introduction https://essaywritingservicebbc.com

# how to write an good essay x485os 2023/03/08 20:02 EugeneSib

You stated that really well.
cheap essay services https://bestpaperwritingservice.com how to write essays in college https://helpwritingdissertation.com

# essay help live chat n530wo 2023/03/09 10:40 Gregorysaipt


Whoa a lot of very good data.
how to write an essay for a scholarship https://bestmasterthesiswritingservice.com write an argumentative essay https://essaytyperhelp.com

# college entry essays v434cd 2023/03/10 2:49 EugeneSib


Nicely put, Thanks!
unique college essays https://writingthesistops.com best essay writing https://essaywritingservicelinked.com

# write an analysis essay b39zvb 2023/03/10 8:04 Gregorysaipt


Wonderful advice. Cheers.
websites for essays in english https://service-essay.com how to write an essay introduction paragraph https://paperwritingservicecheap.com

# how to motivate yourself to write an essay u59swh 2023/03/12 13:47 EugeneSib


With thanks! Plenty of material!
the best college essay ever https://bestonlinepaperwritingservices.com custom essays services https://bestpaperwritingservice.com

# homework essay help h705eh 2023/03/13 1:08 Gregorysaipt


Incredible lots of good tips.
act writing essay https://domycollegehomeworkforme.com writing essays help https://custompaperwritersservices.com

# analysis dissertation o32gby 2023/03/13 19:02 EugeneSib


Whoa many of fantastic tips.
how to write a film analysis essay https://englishessayhelp.com help write personal statement https://hireawriterforanessay.com

# dissertation and thesis writing x96uib 2023/04/02 7:28 EugeneSib


Wow lots of wonderful knowledge.
essays to write https://bestpaperwritingservice.com how to write an descriptive essay https://bestonlinepaperwritingservices.com

# The plugins developed for WordPress 2023/05/09 23:11 Justas

The plugins developed for WordPress serve to enhance the features and functions of a WordPress website, allowing you to build your awesome and functional site https://t.me/wpigaming/648 Customise WordPress with powerful, professional and intuitive fields.

タイトル
名前
Url
コメント