diff --git a/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md b/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md deleted file mode 100644 index 37933e7f1e0b8cd42f378c5a98545085279956be..0000000000000000000000000000000000000000 --- a/docs/cn/MatrixOne/Get-Started/Tutorial/NYC-test-with-matrixone.md +++ /dev/null @@ -1,215 +0,0 @@ -# **瀹屾垚NYC娴嬭瘯** - -**NYC Taxi(绾界害鍑虹杞�)** 鏁版嵁闆嗘敹闆嗕簡绾界害甯傛暟鍗佷嚎鍑虹杞﹁绋嬬殑璇︾粏淇℃伅锛屽寘鎷帴閫佹棩鏈�/鏃堕棿銆佹帴閫佸湴鐐广€佽绋嬭窛绂汇€佽缁嗙エ浠枫€佽垂鐜囥€佹敮浠樼被鍨嬪拰涔樺鏁伴噺銆� -閫氳繃鏈暀绋嬶紝鎮ㄥ皢浜嗚В濡備綍浣跨敤MatrixOne鏉ュ畬鎴愬NYC Taxi鏁版嵁闆嗙殑鏌ヨ銆� - -璇ユ暟鎹泦鐨勮缁嗕俊鎭互鍙婁笅杞芥暀绋嬪彲鍙傝锛� - -* [https://github.com/toddwschneider/nyc-taxi-data](https://github.com/toddwschneider/nyc-taxi-data) - -* [http://tech.marksblogg.com/billion-nyc-taxi-rides-redshift.html](http://tech.marksblogg.com/billion-nyc-taxi-rides-redshift.html). - -## **鍑嗗宸ヤ綔** - -纭繚浣犲凡缁忓畨瑁呬簡[鍗曟満鐗圡atrixOne](../install-standalone-matrixone.md)骞禰杩炴帴鍒癕atrixOne鏈嶅姟](../connect-to-matrixone-server.md). - -## **1. 涓嬭浇骞跺鍏ユ暟鎹�** - -鏈妭鏁欑▼鍙傝€僛https://github.com/toddwschneider/nyc-taxi-data](https://github.com/toddwschneider/nyc-taxi-data)锛屾偍鍙互浠庢澶勪簡瑙e叧浜庢暟鎹泦涓嬭浇鍜屽鍏ョ殑璇︾粏淇℃伅銆� -璇ユ暟鎹泦鍏辨湁17浜胯鏁版嵁锛屽崰鐢�450 GB鐨勭┖闂达紝璇风‘淇濇湁瓒冲鐨勭┖闂存潵瀛樻斁鏁版嵁銆� - -* <font size=4>**瀹夎PostgreSQL涓嶱ostGIS**</font> - -鍦∕ac涓婏紝涓よ€呭潎鍙€氳繃[Homebrew](https://brew.sh)瀹夎銆� - -* <font size=4>**涓嬭浇鍘熷鏁版嵁**</font> - -``` -./download_raw_data.sh && ./remove_bad_rows.sh -``` - -`remove_bad_rows.sh`鑴氭湰淇浜嗕袱涓壒瀹氱殑鏂囦欢锛屽叾涓暟鎹瀬灏戜絾鏄垪瀛楁寰堝銆� - -* <font size=4>**鍒濆鍖栨暟鎹簱**</font> - -``` -./initialize_database.sh -``` - -* <font size=4>**瀵煎叆鏁版嵁**</font> - -``` -./import_trip_data.sh -./import_fhv_trip_data.sh -``` - -* <font size=4>**鍙€夋搷浣滐細涓嬭浇骞跺鍏�2014骞碪ber鏁版嵁**</font> - -FiveThirtyEight Uber鏁版嵁闆嗗寘鍚簡2014骞�4鏈堣嚦9鏈堢殑Uber鍑鸿璁板綍銆俇ber鍜屽叾浠朏HV (Lyft銆丣uno銆乂ia绛�)鐨勬暟鎹嚜2015骞�1鏈堜互鏉ュ氨琚瓨鍌ㄥ湪TLC涓€� - -``` -./download_raw_2014_uber_data.sh -./import_2014_uber_trip_data.sh -``` - -## **2. 浠嶱ostgreSQL瀵煎嚭鏁版嵁** - -``` -COPY -( - SELECT trips.id, - trips.vendor_id, - trips.pickup_datetime, - trips.dropoff_datetime, - trips.store_and_fwd_flag, - trips.rate_code_id, - trips.pickup_longitude, - trips.pickup_latitude, - trips.dropoff_longitude, - trips.dropoff_latitude, - trips.passenger_count, - trips.trip_distance, - trips.fare_amount, - trips.extra, - trips.mta_tax, - trips.tip_amount, - trips.tolls_amount, - trips.ehail_fee, - trips.improvement_surcharge, - trips.total_amount, - trips.payment_type, - trips.trip_type, - trips.pickup_location_id, - trips.dropoff_location_id, - - cab_types.type cab_type, - - weather.precipitation rain, - weather.snow_depth, - weather.snowfall, - weather.max_temperature max_temp, - weather.min_temperature min_temp, - weather.average_wind_speed wind, - - pick_up.gid pickup_nyct2010_gid, - pick_up.ctlabel pickup_ctlabel, - pick_up.borocode pickup_borocode, - pick_up.boroname pickup_boroname, - pick_up.ct2010 pickup_ct2010, - pick_up.boroct2010 pickup_boroct2010, - pick_up.cdeligibil pickup_cdeligibil, - pick_up.ntacode pickup_ntacode, - pick_up.ntaname pickup_ntaname, - pick_up.puma pickup_puma, - - drop_off.gid dropoff_nyct2010_gid, - drop_off.ctlabel dropoff_ctlabel, - drop_off.borocode dropoff_borocode, - drop_off.boroname dropoff_boroname, - drop_off.ct2010 dropoff_ct2010, - drop_off.boroct2010 dropoff_boroct2010, - drop_off.cdeligibil dropoff_cdeligibil, - drop_off.ntacode dropoff_ntacode, - drop_off.ntaname dropoff_ntaname, - drop_off.puma dropoff_puma - - FROM trips - LEFT JOIN cab_types - ON trips.cab_type_id = cab_types.id - LEFT JOIN central_park_weather_observations weather - ON weather.date = trips.pickup_datetime::date - LEFT JOIN nyct2010 pick_up - ON pick_up.gid = trips.pickup_nyct2010_gid - LEFT JOIN nyct2010 drop_off - ON drop_off.gid = trips.dropoff_nyct2010_gid -) TO '/matrixone/export_data/trips.tsv'; -``` - -## **3. 鍦∕atrixOne涓缓琛�** - -``` -CREATE TABLE trips -( - trip_id int unsigned, - vendor_id varchar(64), - pickup_datetime bigint unsigned, - dropoff_datetime bigint unsigned, - store_and_fwd_flag char(1), - rate_code_id smallint unsigned, - pickup_longitude double, - pickup_latitude double, - dropoff_longitude double, - dropoff_latitude double, - passenger_count smallint unsigned, - trip_distance double, - distance bigint, - fare_amount float, - extra float, - mta_tax float, - tip_amount float, - tolls_amount float, - ehail_fee float, - improvement_surcharge float, - total_amount float, - payment_type varchar(64), - trip_type smallint unsigned, - pickup varchar(64), - dropoff varchar(64), - cab_type varchar(64), - precipitation float, - snow_depth float, - snowfall float, - max_temperature smallint, - min_temperature smallint, - average_wind_speed float, - pickup_nyct2010_gid smallint unsigned, - pickup_ctlabel varchar(64), - pickup_borocode smallint unsigned, - pickup_boroname varchar(64), - pickup_ct2010 varchar(64), - pickup_boroct2010 varchar(64), - pickup_cdeligibil char(1), - pickup_ntacode varchar(64), - pickup_ntaname varchar(64), - pickup_puma varchar(64), - dropoff_nyct2010_gid smallint unsigned, - dropoff_ctlabel varchar(64), - dropoff_borocode smallint unsigned, - dropoff_boroname varchar(64), - dropoff_ct2010 varchar(64), - dropoff_boroct2010 varchar(64), - dropoff_cdeligibil varchar(64), - dropoff_ntacode varchar(64), - dropoff_ntaname varchar(64), - dropoff_puma varchar(64) -) ; -``` - -## **4. 鍚戣〃涓彃鍏ユ暟鎹�** - -``` -load data infile '/matrixone/export_data/trips.tsv ' into table trips -FIELDS TERMINATED BY ',' -LINES TERMINATED BY '\n'; -``` - -鐒跺悗渚垮彲浠ヤ娇鐢∕atrixOne涓殑鏌ヨ璇彞鏉ユ煡璇㈣〃涓暟鎹€� - -## **5. Run Queries** - -``` -# Q1 -SELECT cab_type, count(*) FROM trips GROUP BY cab_type; - -# Q2 -SELECT passenger_count, avg(total_amount) FROM trips GROUP BY passenger_count; - -# Q3 -SELECT passenger_count, year(pickup_datetime) as year, count(*) FROM trips GROUP BY passenger_count, year; - -# Q4 -SELECT passenger_count, year(pickup_datetime) as year, round(trip_distance) AS distance, count(*) as count -FROM trips -GROUP BY passenger_count, year, distance -ORDER BY year,count DESC; -``` diff --git a/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md b/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md index 49e2d51f4777138dba584210c00408917b2a6a64..a8bcf78992b802f257e6eb2a87cdb1605258c296 100644 --- a/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/Tutorial/SSB-test-with-matrixone.md @@ -1,11 +1,11 @@ # **瀹屾垚SSB娴嬭瘯** -SSB鏄熷瀷妯″紡鍩哄噯娴嬭瘯鏄疧LAP鏁版嵁搴撴€ц兘娴嬭瘯鐨勫父鐢ㄥ満鏅紝閫氳繃鏈瘒鏁欑▼锛屾偍鍙互浜嗚В鍒板浣曞湪MatrixOne涓疄鐜癝SB娴嬭瘯銆� +SSB 鏄熷瀷妯″紡鍩哄噯娴嬭瘯鏄� OLAP 鏁版嵁搴撴€ц兘娴嬭瘯鐨勫父鐢ㄥ満鏅紝閫氳繃鏈瘒鏁欑▼锛屾偍鍙互浜嗚В鍒板浣曞湪 MatrixOne 涓疄鐜� SSB 娴嬭瘯銆� ## **鍑嗗宸ヤ綔** 纭繚浣犲凡缁忓畨瑁呬簡[鍗曟満鐗圡atrixOne](../install-standalone-matrixone.md)骞禰杩炴帴鍒癕atrixOne鏈嶅姟](../connect-to-matrixone-server.md). - + ## **1. 缂栬瘧dbgen** ``` @@ -26,6 +26,12 @@ $ ./dbgen -s 1 -T s $ ./dbgen -s 1 -T d ``` +鎴戜滑杩樺噯澶囦簡 1GB 鐨勬暟鎹泦渚涗綘涓嬭浇銆備綘鍙互鍦ㄤ笅闈㈤摼鎺ヤ腑鐩存帴鑾峰彇鏁版嵁鏂囦欢锛� + +``` +https://community-shared-data-1308875761.cos.ap-beijing.myqcloud.com/lineorder_flat.tar.bz2 +``` + ## **3. 鍦∕atrixOne涓缓琛�** ``` @@ -154,12 +160,6 @@ CREATE TABLE lineorder_flat( ## **4. 瀵煎叆鏁版嵁** -灏哷system_vars_config.toml`鍙傛暟澧炲ぇ锛屼緥濡�10GB锛岀劧鍚庨噸鏂板惎鍔∕atrixOne鏈嶅姟銆� - -``` -max-entry-bytes = "10GB" -``` - 浣跨敤濡備笅鍛戒护灏嗘暟鎹鍏ョ浉鍏宠〃锛� ``` diff --git a/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md b/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md index 41707a3aefdee33828060cbf210df7839ee66538..f7deb5f8beace34a2176e494ac3889d6c58956bc 100644 --- a/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md +++ b/docs/cn/MatrixOne/Get-Started/install-standalone-matrixone.md @@ -1,6 +1,12 @@ # **瀹夎鍗曟満鐗� MatrixOne** -浣滀负涓€娆惧紑婧愭暟鎹簱锛孧atrixOne 鐩墠鏀寔涓绘祦鐨� Linux 鍜� MacOS 绯荤粺銆備綘鍙互鐩存帴浠嶽婧愪唬鐮乚(#浣跨敤婧愪唬鐮佹惌寤�)鎼缓鍗曟満鐗堟湰鐨� MatrixOne锛屼篃鍙互浣跨敤[Docker](#浣跨敤docker)瀹夎閮ㄧ讲銆� +浣滀负涓€娆惧紑婧愭暟鎹簱锛孧atrixOne 鐩墠鏀寔涓绘祦鐨� Linux 鍜� MacOS 绯荤粺銆備綘鍙互閫氳繃浠ヤ笅涓夌鏂规硶瀹夎鍗曟満鐗� MatrixOne锛� + +- [鏂规硶 1锛氫娇鐢ㄦ簮浠g爜鎼缓](#鏂规硶 1锛氫娇鐢ㄦ簮浠g爜鎼缓) +- [鏂规硶 2锛氫笅杞戒簩杩涘埗鍖匽(#鏂规硶 2锛氫笅杞戒簩杩涘埗鍖�) +- [鏂规硶 3锛氫娇鐢� Docker](鏂规硶 3锛氫娇鐢� Docker) + +鎺ㄨ崘纭欢瑙勬牸锛歺86 CPU锛�4鏍革紱32GB 鍐呭瓨锛屾敮鎸� CentOS 7+ 鎿嶄綔绯荤粺銆� ## **鏂规硶 1锛氫娇鐢ㄦ簮浠g爜鎼缓** @@ -29,6 +35,7 @@ $ cd matrixone ``` $ git clone https://github.com/matrixorigin/matrixone.git +$ git checkout 0.5.0 $ cd matrixone ``` @@ -97,10 +104,18 @@ $ docker --version #### 2. 鍒涘缓骞惰繍琛屽鍣� -浣跨敤浠ヤ笅鍛戒护灏嗕粠 Docker Hub 涓媺鍙栨渶杩戠殑 MatrixOne 闀滃儚锛� +浣跨敤浠ヤ笅鍛戒护灏嗕粠 Docker Hub 涓媺鍙� MatrixOne 闀滃儚锛屼綘鍙互閫夋嫨鏈€鏂扮殑闀滃儚锛屾垨绋冲畾鐗堟湰鐨勯暅鍍忋€� + +- 鏈€鏂扮増鏈殑闀滃儚锛� + +``` +$ docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:latest +``` + +- 0.5.0 绋冲畾鐗堟湰鐨勯暅鍍� ``` -$ docker run -d -p 6001:6001 --鍚嶇О matrixone matrixorigin/matrixone:latest +$ docker run -d -p 6001:6001 --name matrixone matrixorigin/matrixone:0.5.0 ``` 杩愯 Docker Hub 鏃堕渶瑕佽緭鍏ョ敤鎴峰悕鍜屽瘑鐮侊紝鑾峰彇鐢ㄦ埛鍚嶅拰瀵嗙爜鍙互鍙傝€冧笅涓€姝ラ - 杩炴帴 MatrixOne 鏈嶅姟 diff --git a/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md b/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md deleted file mode 100644 index c77b28aa5fcafe6371ae5263f44ab039c8d400c0..0000000000000000000000000000000000000000 --- a/docs/cn/MatrixOne/Overview/NYC-Test-Performance.md +++ /dev/null @@ -1,38 +0,0 @@ -# **NYC鎬ц兘娴嬭瘯缁撴灉** - -## **姒傝堪** - -鍦∕atrixOne v0.2.0鐗堟湰锛屾垜浠湪鍗曟満涓婇伒鐓鐩稿叧娴佺▼](../Get-Started/Tutorial/NYC-test-with-matrixone.md)瀹炵幇浜�**绾界害鍑虹杞︽暟鎹祴璇�**锛屽苟灏嗘祴璇曠粨鏋滀笌鍏朵粬浜у搧鐩告瘮杈冿紝浣撶幇浜哅atrixOne鍦ㄦ煡璇㈠鐞嗘椂闂翠笂鐨勪紭寮傛€с€� - -!!! note <font size=4>璇存槑</font> - <font size=3>浠ヤ笅娴嬭瘯缁撴灉鏍规嵁 MatrixOne v0.2.0 鐗堟湰娴嬭瘯寰楀嚭锛屽潎鍙栦笁娆℃渶濂界粨鏋滅殑骞冲潎鍊硷紝浠ョ涓哄崟浣嶃€�</font> - -## **鍗曟満娴嬭瘯** - -!!! info 娴嬭瘯閰嶇疆 - 娴嬭瘯鎵€鐢ㄦ湇鍔″櫒閰嶇疆濡備笅锛� - AMD EPYC鈩� Rome CPU 2.6GHz/3.3GHz锛�16鏍革紝32GiB鍐呭瓨銆� - -| 鏌ヨ缂栧彿 | MatrixOne 0.2.0 | ClickHouse v21.11.4.14 | Starrocks v1.19.3<br>(浠呮湁3000涓囪鐙珛鏁版嵁) -| :----: | :----: | :----: |:----: -| Q1 | 8.37|5.99 |2.58 -| Q2 | 2.67|4.13 |2.18 -| Q3 | 3.48|4.56 |3.43 -| Q4 | 5.34|7.09 |4.19 -| 鎬诲拰| 19.86|21.77|12.38 - - -* [SSB娴嬭瘯鎶ュ憡](SSB-Test-Performance.md) diff --git a/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md b/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md deleted file mode 100644 index 3c591475d0119f48965d6eb741cfd4f866826e7f..0000000000000000000000000000000000000000 --- a/docs/cn/MatrixOne/Overview/SSB-Test-Performance.md +++ /dev/null @@ -1,81 +0,0 @@ -# **SSB娴嬭瘯鎬ц兘鎶ュ憡** - -## **姒傝堪** - -鍦ㄦ锛屾垜浠粰鍑轰簡浣跨敤MatrixOne鍦ㄤ笉鍚岀殑纭欢鍜屾煡璇㈡潯浠朵笅杩涜SSB娴嬭瘯鐨勬€ц兘缁撴灉銆� -鍙弬瑙乕瀹屾垚SSB娴嬭瘯](../Get-Started/Tutorial/SSB-test-with-matrixone.md)鏉ュ鐜版暣涓祴璇曠粨鏋滐紝濡傛灉鏈兘瀹炵幇绫讳技缁撴灉锛屽彲鑳介渶瑕佹鏌ョ‖浠躲€佽礋杞芥垨鎴栨祴璇曟祦绋嬫槸鍚﹀瓨鍦ㄩ棶棰橈紝鍙互鍦℅itHub涓婃彁鍑篬issue](https://github.com/matrixorigin/matrixone/issues/new/choose)鏉ユ姤鍛婂叿浣撻棶棰樸€� -鍦╲0.2.0涓紝MatrixOne鍦ㄥ崟琛ㄣ€佸琛ㄦ煡璇㈡柟闈㈠潎鏈変紭寮傜殑琛ㄧ幇锛屾垜浠皢MatrixOne鐨勬€ц兘娴嬭瘯缁撴灉涓庡叾浠栨暟鎹簱浜у搧杩涜浜嗘瘮杈冦€傞€氳繃鏌辩姸鍥撅紝鍙互鐪嬪嚭MatrixOne鍦ㄦ煡璇㈠鐞嗘椂闂翠笂鏈夋槑鏄剧殑浼樺娍銆� - -鎺ㄨ崘娴嬭瘯浣跨敤鐨勬湇鍔″櫒瑙勬牸鍨嬪彿锛歺86 CPU锛�16鏍革紝64GB鍐呭瓨锛孋entOS 7+鎿嶄綔绯荤粺銆� - -!!! note <font size=4>璇存槑</font> - <font size=3>浠ヤ笅娴嬭瘯缁撴灉鏍规嵁 MatrixOne v0.2.0 鐗堟湰娴嬭瘯寰楀嚭锛屽潎鍙栦笁娆℃渶濂界粨鏋滅殑骞冲潎鍊硷紝浠ョ涓哄崟浣�</font> - -涓轰簡灞曠ず鍗曡〃鏌ヨ鑳藉姏锛屽皢浜斿紶琛ㄥ悎鎴愪负涓€寮犲琛細`lineorder_flat`銆� - -## **鍗曟満鍗曡〃** - -浣跨敤鍗曟満鎼浇MatrixOne鎵ц瀵瑰琛╜lineorder_flat`鐨勬煡璇紝骞朵笌鐩稿悓閰嶇疆涓嬬殑鍏朵粬鏁版嵁搴撹繘琛屾瘮杈冦€� -`lineorder_flat`鍏辨湁6浜胯鏁版嵁锛屽叡鍗犳嵁220 GB绌洪棿銆� - -!!! info 娴嬭瘯閰嶇疆 - 娴嬭瘯鎵€鐢ㄦ湇鍔″櫒閰嶇疆濡備笅锛� - AMD EPYC鈩� Rome CPU 2.6GHz/3.3GHz锛�16鏍革紝32GiB鍐呭瓨銆� - -| 鏌ヨ缂栧彿 | MatrixOne v0.2.0 | ClickHouse v21.11.4.14 -| :----: | :----: | :----: -| Q2 | 2.71 |3.82 -| Q3.1 | 4.23|5.01 -| Q3.2 | 11.05|21.34 -| Q4.1 | 2.94|3.1 -| Q4.2 | 4.27|5.32 -| Q4.3 | 16.91|26.32 -| 鎬诲拰 | 42.11|64.91 - - -* [NYC娴嬭瘯缁撴灉](NYC-Test-Performance.md) diff --git a/docs/cn/MatrixOne/Overview/mysql-compatibility.md b/docs/cn/MatrixOne/Overview/mysql-compatibility.md index e2df686dba552cf59427d63df6d63009ad6e46fb..1fd2e75c21641025a7e11b09a2af00c2daa5c09e 100644 --- a/docs/cn/MatrixOne/Overview/mysql-compatibility.md +++ b/docs/cn/MatrixOne/Overview/mysql-compatibility.md @@ -6,7 +6,7 @@ MatrixOne鐨凷QL璇硶鍏煎浜哅ySQL 8.0.23鐗堟湰銆� | ---- | ---- | ---- | | DDL | CREATE DATABASE | 涓嶆敮鎸佷腑鏂囧懡鍚嶇殑琛ㄥ悕 | | | | 鏀寔閮ㄥ垎鎷変竵璇� | -| | | CHARSET, COLLATE, ENCRYPTION 鐩墠鍙互浣跨敤浣嗘棤娉曠敓鏁� | +| | | `CHARSET`锛宍COLLATE`锛宍ENCRYPTION` 鐩墠鍙互浣跨敤浣嗘棤娉曠敓鏁� | | | CREATE TABLE | 涓嶆敮鎸佷复鏃惰〃 | | | | 涓嶆敮鎸佽〃鐨勫垎鍖� | | | | 涓嶆敮鎸� `Create table .. as` 璇彞 | diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md index 679e67f9716dea5ef865e1c9da5197676cc261f9..7c95dd357b9dd81e58d8338aef5c6cbcabb2029c 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md @@ -33,5 +33,6 @@ ``` ## **闄愬埗** - -鐩墠鍙敮鎸� `UTF-8` 瀛楃闆嗐€� \ No newline at end of file + +- 鐩墠鍙敮鎸� `UTF-8` 瀛楃闆嗐€� +- `CHARACTER SET`锛宍COLLATE`锛宍ENCRYPTION` 鐩墠鍙互浣跨敤浣嗘棤娉曠敓鏁� diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md deleted file mode 100644 index b48ef668aa735b98d6492c9dc7185dd8289c5b59..0000000000000000000000000000000000000000 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-index.md +++ /dev/null @@ -1,23 +0,0 @@ -# **CREATE INDEX** - -## **璇硶璇存槑** - -`CREATE INDEX` 璇彞涓哄凡鏈夎〃`table_name`鐨勬煇鍒楁坊鍔犳柊绱㈠紩銆� - -## **璇硶缁撴瀯** - -``` -> CREATE INDEX index_name ON table_name (column_name) - -``` - -## **绀轰緥** - -``` -> CREATE INDEX PIndex ON Persons (LastName); - -``` - -## **闄愬埗** - -鐩墠绱㈠紩鍙兘搴旂敤浜庡崟鍒椼€傛澶栵紝杩樹笉鏀寔鎸囧畾绱㈠紩绫诲瀷锛宍UNIQUE/FULLTEXT` 璇彞杩樹笉鏀寔銆� \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md deleted file mode 100644 index d91cb437f5bdc8d2b8114f7135c1bfb59b504350..0000000000000000000000000000000000000000 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/drop-index.md +++ /dev/null @@ -1,18 +0,0 @@ -# **DROP INDEX** - -## **璇硶璇存槑** - -`DROP INDEX` 浠庤〃`table_name` 涓垹闄ゅ悕涓篳index_name`鐨勭储寮曘€� - -## **璇硶缁撴瀯** - -``` -> DROP INDEX index_name ON table_name; -``` - -## **绀轰緥** - -``` -> DROP INDEX PIndex ON Persons; - -``` \ No newline at end of file diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md index 6d105f5514f5c96cc2593b8aa436e1414f440e72..a406822b3ef7083a1ba4e985376d559e38e728d8 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/primary-key.md @@ -4,7 +4,7 @@ `PRIMARY KEY` 鍗充富閿害鏉燂紝鐢ㄤ簬鍞竴鏍囩ず琛ㄤ腑鐨勬瘡鏉℃暟鎹€� 涓婚敭蹇呴』鍖呭惈 `UNIQUE` 鍊硷紝涓嶈兘鍖呭惈 `NULL` 鍊笺€� -涓€涓〃鍙兘鏈変竴涓富閿紝浣嗕竴涓富閿彲浠ュ寘鍚竴涓垨澶氫釜鍒椼€� +涓€涓〃鍙兘鏈変竴涓富閿紝浣嗕竴涓富閿彲浠ュ寘鍚竴涓垪銆� ## **鍦ㄥ缓琛ㄦ椂鍒涘缓涓婚敭** @@ -20,21 +20,10 @@ ); ``` -鑻ヨ瀵逛富閿繘琛屽懡鍚嶏紝骞舵寚瀹氬涓垪涓轰富閿紝鍙弬鑰冨涓嬭鍙ワ細 - -``` -> CREATE TABLE Persons ( - ID int NOT NULL, - LastName varchar(255) NOT NULL, - FirstName varchar(255), - Age int, - CONSTRAINT PK_Person PRIMARY KEY (ID,LastName) -); -``` - !!! Note 娉ㄦ剰鍖哄垎 涓婅堪绀轰緥涓彧鏈変竴涓富閿� `PK_Person`, 浣嗗叾涓寘鍚簡涓ゅ垪锛坄ID`涓巂LastName`锛� ## **闄愬埗** -鐩墠涓嶆敮鎸� `DROP PRIMARY KEY` 璇彞銆� \ No newline at end of file +- 鐩墠涓嶆敮鎸� 甯︽湁 `ALTER TABLE` 鐨� `DROP PRIMARY KEY` 璇彞銆� +- 涓嶆敮鎸佸鍚堜富閿紙鍗崇敱澶氫釜鍒楃粍鎴愮殑涓婚敭锛屼负澶嶅悎涓婚敭) diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md index 089d8136e50a159e22ab7c7c32a885345eec82a1..e0170773651e8884ee633ae455f873d0cb67ff38 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/insert.md @@ -24,3 +24,7 @@ | 123 | abc | +------+---------+ ``` + +## **闄愬埗** + +鐩墠涓嶆敮鎸� `INSERT INTO鈥ALUES(function)` 璇硶涓殑鍐呯疆鍑芥暟銆� diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md index 28258d2377dba4241e64061421a833a52a0a43ab..3c9780e74e408d789c31f3ed46d7ab484c830685 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/load-data.md @@ -8,12 +8,8 @@ ``` > LOAD DATA - [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' - [REPLACE | IGNORE] INTO TABLE tbl_name - [PARTITION (partition_name [, partition_name] ...)] - [CHARACTER SET charset_name] [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] @@ -23,11 +19,6 @@ [STARTING BY 'string'] [TERMINATED BY 'string'] ] - [IGNORE number {LINES | ROWS}] - [(col_name_or_user_var - [, col_name_or_user_var] ...)] - [SET col_name={expr | DEFAULT} - [, col_name={expr | DEFAULT}] ...] ``` * `TERMINATED BY`锛宍ENCLOSED BY`绛夊垎闅旂鐨勬剰涔変笌`SELECT INTO`涓€鑷淬€� @@ -42,3 +33,7 @@ ```sql > LOAD DATA INFILE '/ssb-dbgen-path/lineorder_flat.tbl ' INTO TABLE lineorder_flat; ``` + +## **闄愬埗** + +褰撳墠浠呮敮鎸� `csv` 鏍煎紡鐨勬枃浠躲€� diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/operators/cast-functions-and-operators/cast.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/operators/cast-functions-and-operators/cast.md index 7ae6421d5a4a84e114a6f7e8b1b01af0a6196df1..a20fe11038c5e7c9499cd85286aadd8a7ba1abe2 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/operators/cast-functions-and-operators/cast.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/operators/cast-functions-and-operators/cast.md @@ -24,6 +24,8 @@ * 鏁板€肩被鍨嬪悜瀛楃CHAR绫诲瀷杞崲 * 鏍煎紡涓烘暟鍊肩殑瀛楃绫诲瀷鍚戞暟鍊肩被鍨嬭浆鎹紙璐熸暟闇€瑕佽浆鎹负SIGNED锛� +璇︾粏鐨勬暟鎹被鍨嬭浆鎹㈣鍒欙紝璇峰弬瑙乕鏁版嵁绫诲瀷杞崲](../../../../Data-Types/data-type-conversion.md)銆� + ## **绀轰緥** ```sql diff --git a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md index 8ae6a644baced9d699c253cc177d39b51e8aa17e..dc885baf13aa8e51e21ddcd4ef04614913da1718 100644 --- a/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md +++ b/docs/cn/MatrixOne/Reference/SQL-Reference/Data-Manipulation-Statements/select.md @@ -7,69 +7,20 @@ ## **璇硶缁撴瀯** ``` sql -> SELECT - [ALL | DISTINCT] - select_expr [[AS] alias], ... +SELECT + [ALL | DISTINCT ] + select_expr [, select_expr] [[AS] alias] ... [INTO variable [, ...]] - [ FROM table_references - [WHERE expr] - [GROUP BY {{col_name | expr | position}, ... - | extended_grouping_expr}] - [HAVING expr] - [ORDER BY {col_name | expr} [ASC | DESC], ...] - [LIMIT row_count] - [OFFSET row_count] - ] + [FROM table_references + [WHERE where_condition] + [GROUP BY {col_name | expr | position} + [ASC | DESC]] + [HAVING where_condition] + [ORDER BY {col_name | expr | position} + [ASC | DESC]] + [LIMIT {[offset,] row_count | row_count OFFSET offset}] ``` -### **SELECT INTO** - -`SELECT INTO` 璇彞灏嗘煡璇㈢粨鏋滃瓨鍌ㄥ湪鍙橀噺鎴栬€呭鍑轰负鏂囦欢銆� - -* SELECT ... INTO ***var_list*** 鍙互妫€绱㈠垪鍊煎苟灏嗗叾瀛樺偍鍒板彉閲忎腑銆� -* SELECT ... INTO OUTFILE 灏嗘绱㈢粨鏋滆緭鍑轰负鏂囦欢锛屽彲浠ヤ娇鐢ㄨ/鍒楀垎闅旂鏉ョ敓鎴愮壒瀹氱殑鏍煎紡銆� - -``` sql -> SELECT <expr_list> - INTO OUTFILE 'file_name' - [{FIELDS} - [TERMINATED BY 'char'] - [ENCLOSED BY 'char'] - ] - [LINES - [TERMINATED BY 'string'] - ] - [HEADER 'bool'] - [MAX_FILE_SIZE long] - [FORCE_QUOTE {'col1','col2',...}] -``` - -#### 鍙傛暟閲婁箟 - -* `<expr_list>` 鏄綘鎯宠緭鍑虹殑妫€绱㈢粨鏋滐紝涓哄繀閫夊弬鏁般€� -* `'file_name'` 涓烘湰鏈轰笂浣犳墍瀵煎嚭鐨勬枃浠剁殑鏂囦欢鍚嶏紝浠ョ粷瀵硅矾寰勩€傝嫢瀛樺湪鍚屽悕鏂囦欢锛屽垯浼氬鑷村鍑哄け璐ャ€傛澶栵紝璺緞涓殑鎵€鏈夊墠缃枃浠跺す閮藉繀椤讳簨鍏堝垱寤猴紝璇ュ懡浠や笉浼氳嚜鍔ㄥ垱寤烘墍闇€瑕佺殑鏂囦欢澶广€� -* `TERMINATED BY` 琚敤鏉ユ寚瀹氬瓧娈靛垎闅旂锛岄粯璁ゅ€间负閫楀彿 `,`銆� -* `ENCLOSED BY` 鎸囧畾浜嗗垪瀛楁鍖呮嫭绗︼紝榛樿涓哄弻寮曞彿 `"`銆� -* `LINES TERMINATED BY` 琛ㄧず琛岀粨鏉熺锛岄粯璁や负鎹㈣绗� `\n`銆� -* `HEADER` 鐢ㄤ簬璁剧疆鏂囦欢涓槸鍚﹀寘鍚瘡涓€鍒楀悕绉扮殑鏍囬琛岋紝褰撲负`TRUE`鏃讹紝杈撳嚭鍖呭惈鏍囬琛岋紝鍙嶄箣鍒欎笉鍖呭惈銆� -* 浣犲彲浠ラ€氳繃`MAX_FILE_SIZE`闄愬埗杈撳嚭鏂囦欢鐨勫ぇ灏忥紙浠B涓哄崟浣嶏級銆� - 渚嬪锛屽綋`MAX_FILE_SIZE`=5242880(5GB)鏃讹紝10GB鐨勮〃灏变細琚鍑轰负涓や釜鏂囦欢锛屾枃浠跺懡鍚嶈鍒欎负鍘熸枃浠跺悕鍚庣紑鍔犱笂`.搴忓彿`銆傝嫢涓嶈缃鍊硷紝閭d箞榛樿杈撳嚭涓€涓枃浠躲€� -* `FORCE_QUOTE`寮哄埗瀵规瘡涓寚瀹氬垪涓墍鏈夐潪NULL鍊间娇鐢ㄥ紩鐢紝浣跨敤鍙屽紩鍙蜂綔涓烘爣璇嗐€� -* `NULL` 鍊煎皢琚鍑轰负`\N`銆� -* `HAVING` 鎸囧畾缁勭殑鏉′欢锛岄€氬父涓� `GROUP BY` 浠庡彞涓€璧蜂娇鐢ㄣ€傛煡璇㈢殑缁撴灉鏄彧鍖呭惈婊¤冻 `HAVING` 鏉′欢鐨勭粍銆�(濡傛灉娌℃湁 `GROUP BY`锛屽垯鎵€鏈夎鑷姩缁勬垚鍗曚釜鑱氬悎缁勩€�) - `HAVING` 浠庡彞涓� `WHERE` 浠庡彞涓€鏍凤紝鎸囧畾閫夋嫨鏉′欢銆� 浣� `WHERE` 浠庡彞鎸囧畾閫夋嫨鍒楄〃涓殑鍒楃殑鏉′欢锛屼絾鏄棤娉曞紩鐢ㄨ仛鍚堝嚱鏁般€傚嵆 `WHERE` 鐢ㄤ簬杩囨护鏁版嵁琛岋紝鑰� `HAVING` 鐢ㄤ簬杩囨护鍒嗙粍銆� - `HAVING` 蹇呴』鍙紩鐢� `GROUP BY` 浠庡彞涓殑鍒楁垨鑱氬悎鍑芥暟涓娇鐢ㄧ殑鍒椼€� - 濡傛灉 `HAVING` 浠庡彞鎸囧畾鐨勬槸涓嶆槑纭殑鍒楋紝鍒欎細鍑虹幇璀﹀憡銆� - -!!! info 寤鸿 - 濡傛灉涓嶈缃甡MAX_FILE_SIZE`锛屽綋琛ㄧ殑鏁版嵁閲忓緢澶ф椂浼氳緭鍑轰竴涓瀬澶х殑鏂囦欢锛屽彲鑳藉洜姝ゅ彂鐢熷鍑哄け璐ョ殑鎯呭喌锛涘洜姝ゆ垜浠缓璁偍鏍规嵁瀹為檯鎯呭喌璁剧疆璇ュ€笺€� - -#### 闄愬埗 - - * 鐩稿悓鐩綍涓嬭嫢瀛樺湪鍚屽悕鏂囦欢锛屽垯浼氬鑷村鍑哄け璐ャ€� - * 鐩墠鍙敮鎸佸鍑� ***.csv*** 绫诲瀷鐨勬枃浠躲€� - * 鐩墠鍙敮鎸侀€氳繃缁濆璺緞灏嗘枃浠跺鍑哄埌鏈嶅姟鍣ㄤ富鏈猴紝鑰屼笉鑳藉鍑哄埌杩滅▼瀹㈡埛绔€� - ## **绀轰緥** ```sql @@ -85,19 +36,7 @@ > SELECT * FROM t1 WHERE spID>2 AND userID <2 || userID >=2 OR userID < 2 LIMIT 3; > SELECT userID,MAX(score) max_score FROM t1 WHERE userID <2 || userID > 3 GROUP BY userID ORDER BY max_score; -``` -```sql -select * from t1 into outfile '/Users/tmp/test.csv' -FIELDS TERMINATED BY ',' -ENCLOSED BY '"' -LINES TERMINATED BY '\n' -header 'TRUE' -MAX_FILE_SIZE 9223372036854775807 -FORCE_QUOTE (a, b) -``` - -```sql > create table t1 (spID int,userID int,score smallint); > insert into t1 values (1,1,1); > insert into t1 values (2,2,2); @@ -115,3 +54,9 @@ FORCE_QUOTE (a, b) > select userID,count(score) from t1 where userID>2 group by userID having count(score)>1 order by userID; Empty set (0.01 sec)s ``` + +## **闄愬埗** + +- 鍦� `GROUP BY` 涓殏涓嶆敮鎸佽〃鍒悕. +- 鏆備笉鏀寔 `SELECT...FOR UPDATE` 銆� +- 閮ㄥ垎鏀寔 `INTO OUTFILE`銆� diff --git a/docs/en/MatrixOne/Overview/mysql-compatibility.md b/docs/en/MatrixOne/Overview/mysql-compatibility.md index 2a18e9bceeb501180f9a37b0abba3acb0fa223ad..1c7812bcea1db6e4913ffbeddbd85706e7e68c93 100644 --- a/docs/en/MatrixOne/Overview/mysql-compatibility.md +++ b/docs/en/MatrixOne/Overview/mysql-compatibility.md @@ -1,12 +1,12 @@ -# **MySQL Compatibility** +# **MySQL Compatibility** -MatrixOne SQL syntax conforms with MySQL 8.0.23 version. +MatrixOne SQL syntax conforms with MySQL 8.0.23 version. | SQL Type | SQL Syntax | Compability with MySQL8.0.23 | | ---- | ---- | ---- | | DDL | CREATE DATABASE | A database with Chinese name is not supported. | | | | Names with Latins support limitedly. | -| | | CHARSET, COLLATE, ENCRYPTION can be used but don't work. | +| | | `CHARSET`, `COLLATE`, `ENCRYPTION` can be used but don't work. | | | CREATE TABLE | Temporary tables are not supported. | | | | Partition tables are not supported. | | | | Create table .. as clause is not supported now. | diff --git a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md index 75de3ef183bf994e24131d92bb296a155da5b4d9..0e9df7a9f7313f0b6cece59eeb0494424678fb03 100644 --- a/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md +++ b/docs/en/MatrixOne/Reference/SQL-Reference/Data-Definition-Statements/create-database.md @@ -34,4 +34,5 @@ Create a database. ## **Constraints** -Only `UTF-8` CHARACTER SET is supported for now. +- Only `UTF-8` CHARACTER SET is supported for now. +- `CHARACTER SET`, `COLLATE`, `ENCRYPTION` can be used but don't work.