投稿時間:2022-11-23 19:12:35 RSSフィード2022-11-23 19:00 分まとめ(13件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita 風データをmatplotlibで描画する https://qiita.com/snow_cornice_man/items/f7200df5c923743d3725 matplotlib 2022-11-23 18:52:14
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptスッキリリファクタリング 1 https://qiita.com/economist/items/3372d87b5ff8c500533a javascript 2022-11-23 18:44:24
js JavaScriptタグが付けられた新着投稿 - Qiita AWS Kinesis Video Streamsを使ってブラウザでビデオチャット https://qiita.com/poruruba/items/ab76667a9a6dc00062c4 awskinesisvideostreams 2022-11-23 18:29:48
AWS AWSタグが付けられた新着投稿 - Qiita 【初心者】モデリング用のデータをサニタイズおよび準備を整理してみた https://qiita.com/zumax/items/d763d39e42520016b241 蓄積 2022-11-23 18:30:53
AWS AWSタグが付けられた新着投稿 - Qiita 特定のタグがついたEC2インスタンスを自動停止する https://qiita.com/leomaro7/items/61a72417cf6c6c48a2d1 自動 2022-11-23 18:09:32
Docker dockerタグが付けられた新着投稿 - Qiita 今更Dockerの素晴らしさについて書いてみる https://qiita.com/chinchilla/items/14f808926d4cf6684943 docker 2022-11-23 18:53:05
Git Gitタグが付けられた新着投稿 - Qiita git clone with submodules https://qiita.com/aizwellenstan/items/7f6522de5fea0f09159b https 2022-11-23 18:40:41
海外TECH MakeUseOf Black Friday: Best Software Deals You're Going to Want https://www.makeuseof.com/black-friday-best-software-deals/ awesome 2022-11-23 09:14:15
海外TECH DEV Community Tailwind CSS tutorial #20: Font Variant Numeric https://dev.to/shubhicodes/tailwind-css-tutorial-20-font-variant-numeric-1656 Tailwind CSS tutorial Font Variant NumericIn the article we will go into detail on how to use font variant numeric Font Variant NumericFormatfont variant numericTailwind ClassCSS Propertynormal numsfont variant numeric normalordinalfont variant numeric ordinalslashed zerofont variant numeric slashed zerolining numsfont variant numeric lining numsoldstyle numsfont variant numeric oldstyle numsproportional numsfont variant numeric proportional numstabular numsfont variant numeric tabular numsdiagonal fractionsfont variant numeric diagonal fractionsstacked fractionsfont variant numeric stacked fractions Font variant numeric classes normal nums Using normal nums will remove each effect of the font variant numeric class ordinal This value directly indicates the open type values i e ordn The term makes use of special glyphs for ordinal markers slashed zero This class slashed zero used a zero with a slash which proves to be very useful while distinguishing between and O lining nums This class corresponds to the open type values i e lnum This keyword activates the numbers lying on the baseline oldstyle nums This class corresponds to the open type values i e onum This keyword activates the set of figures where some numbers have descendant proportional nums This class activates those norms where not every number is of the same size Its open type value is pnum tabular nums This class open type value is tnum It activates those sets of figures where a set of numbers is of the same size diagonal fractions It s open type value is frac This activates those sets of figures where numerator and denominator are made smaller and are separated by a slash stacked fractions It s open type value is arac This activates those set of figures where numerator and denominator are made smaller stacked and are separated by a horizontal line Code lt ul class container mx auto divide y divide gray divide dotted gt lt li class flex items center justify between px py gt lt div gt lt div class font sans font light text xl align middle mb style font family Source Sans Pro gt nd lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt normal lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg pink rounded gt normal nums lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class ordinal font sans font light text xl align middle mb style font family Source Sans Pro gt nd lt div gt lt div class text xs font mono text gray mt gt lt span class font bold gt font variant numeric lt span gt ordinal lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg pink rounded gt ordinal lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class slashed zero font sans font light text xl align middle mb style font family Source Sans Pro gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt slashed zero lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg pink rounded gt slashed zero lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class slashed zero font sans font light text xl align middle mb style font family Source Sans Pro gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt lining nums lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg green rounded gt lining nums lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class oldstyle nums font sans font light text xl align middle mb style font family Source Sans Pro gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt oldstyle nums lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg green rounded gt oldstyle nums lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class proportional nums font sans font light text xl align middle style font family Source Sans Pro gt lt div gt lt div class proportional nums font sans font light text xl align middle mb style font family Source Sans Pro gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt proportional nums lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg blue rounded gt proportional nums lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class tabular nums font sans font light text xl align middle style font family Source Sans Pro gt lt div gt lt div class tabular nums font sans font light text xl align middle mb style font family Source Sans Pro gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt tabular nums lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg blue rounded gt tabular nums lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class diagonal fractions font sans font light text xl align middle mb gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt diagonal fractions lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg yellow rounded gt diagonal fractions lt div gt lt li gt lt li class flex items center justify between px py gt lt div gt lt div class stacked fractions font mono font light text xl align middle mb style font family Ubuntu Mono gt lt div gt lt div class text xs font mono font light text gray mt gt lt span class font bold gt font variant numeric lt span gt stacked fractions lt div gt lt div gt lt div class text xs font semibold font mono whitespace nowrap px py ml rounded text white bg yellow rounded gt stacked fractions lt div gt lt li gt lt ul gt Full code The overall code will be attached to repo link Overall OutputResources tailwind cssThank you for reading To learn more check out my blogs on Flex Direction Hackathons and Flex Wrap If you liked this article consider following me on Dev to for my latest publications You can reach me on Twitter Keep learning Keep coding 2022-11-23 09:23:59
海外TECH DEV Community Database Indexing with PostgreSQL https://dev.to/foxeyerinx/database-indexing-with-postgresql-eio Database Indexing with PostgreSQLIndexing is a way to improve reading performance but it also makes writing performance worse so consider using indexes in your application based on your use cases To demonstrate I will use an orders table with million records create table orders id serial primary key total integer unit usd user id integer created at date Then generate total random number in range k user id random number in range k created at random date in range years The orders table should look like this id total user id created at Without index Let s use explain analyze to see the query plan for this query explain analyze select sum total from orderswhere extract year from created at The query will be executed following this plan in inside out order Finalize Aggregate└ーGather └ーPartial Aggregate └ーParallel Seq ScanSo the PostgreSQL will do a Sequential Scan in parallel with workers then for each worker it will do a Partial Aggregation sum function and then Gather the results from workers and then does a Finalized Aggregation sum function In Parallel Seq Scan node it does loops for each loop scans rows To understand how Partial Aggregate work together with Finalize Aggregate read more about PARALLEL AGGREGATION and PARALLEL SEQ SCAN With index An index is designed for a specific query so let s consider two ways of creating the index for two different queries but they serve the same purpose Using index on an expression Now create an index on created at column because we use the extract year from created at expression on the query so we need to use that expression on the index too read more about indexes on expression create index my index on orders extract year from created at explain analyze select sum total from orderswhere extract year from created at Aggregate └ーBitmap Heap Scan └ーBitmap Index ScanNow it uses my index for the scan and the execution time is reduced from ms to ms that is significant Using index on a column There is another way to calculate the total value of orders in using between operatorexplain analyze select sum total from orderswhere created at between and with this query we just need to create the index on created at column create index my index on orders created at Finalize Aggregate └ーGather └ーPartial Aggregate └ーParallel Bitmap Heap Scan └ーBitmap Index ScanWith this pair of index query it turns on the parallel workers and reduced from ms to ms What are Bitmap Index Scan and Bitmap Heap Scan Let s take a look on the table layout and page layout Every table and index is stored as an array of pages Ref All indexes in PostgreSQL are secondary indexes meaning t hat each index is stored separately from the table s main data area which is called the table s heap in PostgreSQL terminology RefAs the page layout is explained in bufpage h ItemId or LinePointer logical offset that point to the actual data Tuple a row record in table within that page New data and its pointer will be added into free space The page is full when free space is full TID Tuple identifier or ItemPointer a pair of page block number LinePointer number that points to a LinePointer ItemId in a page Bitmap Index Scan Scan on the index and create the bitmap Bitmap is an array of bits that shows which page to be fetched First the PostgreSQL will scan the index to find values that match the condition then turn the bit on the corresponding page on the bitmap to Bitmap Heap Scan based on the created bitmap it will do a sequential disk read to the heap to retrieve pages wich are marked then from that pages the Recheck Cond will remove all the rows that do not match with the condition For each matched row on the index if the PostgreSQL do a random IO access to the disk to fetch the entire row it will be very slow because random I O access is way slower than sequential I O access So with the bitmap it will read data in bulk sequential IO access and make sure the matched pages are not read multiple times Adding more column to the index Multicolumn indexes On the example above we see Bitmap Heap Scan to improve the speed we can add both created and total into the index to make an Index Only Scandrop index my index create index my index on orders created at total Because all the information which the query needs are on the index so it does not need to fetch data on the heap ms Bitmap Heap Scan is now reduced to ms Index Only Scan Column order in an multicolumn index We should consider the column order of an index Let s reverse the order from created at total to total created at and try again we will see the planner will not use the index it will do a Seq Scan to the whole table instead drop index my index create index my index on orders total created at With created at total the index will sort data by created at first then sort by total The PostgreSQL will look into the index from left to right If the query matches the index order the planner will use the index On the query above the planner will do an analysis first it will start with the condition gt find all rows with the date in then do an aggregation sum on the found rows But the total is the first column on the index not created at the planner cannot skip the order More column Let s drop the my index and create it again to reorder the columnsdrop index my index create index my index on orders created at total Let s make an example that need more column If we want to know who and how much they bought in the user id is getting involved This is what we want sum user id The query select sum total user id from orderswhere created at between and group by user id It will trigger the index my index but it still needs to read data on the heap to get user id data Let s add user id column to the index drop index my index create index my index on orders created at user id total Now Index Only Scan is used because all the information are stored on the index the execution time is reduced from ms to ms Column order on the index Rows in the index above are sorted by created at if two rows has the same created at value then it will sort them by user id and so on If we want to know the date and how much of orders gt usd that a specific user made in select total created at from orderswhere total gt and user id and created at between and Although the order in the where clause does not match the order in the index PostgreSQL is smart enough to handle it Other database software might not use the index in this case Trying other column orders drop index my index create index my index on orders total user id created at What happened The planner uses Seq Scan instead of Index Only Scan even there is no function on the query and the query s column order matches the index why the planner does not use Index Only Scan To find out use this command to discourage seq scan and try again set enable seqscan off Total cost estimation ms SeqScan lt ms Index Only Scan so the plannerthinks seq scan is faster than the index only scan the estimation can be bad in this case To understand more about cost estimation read more here Instead of helping the estimation become more accurate which is related to many factors that are not the same in your dev staging prod mode Let s try another orders user id created at total drop index my index create index my index on orders user id created at total user id total created at drop index my index create index my index on orders user id total created at Wow just let user id be the first column from ms it reduced to ms ms That is a big improvement In my example database it has rows that total gt but a specific user only has around rows so if the index is sorted by user id first it will eliminate almost all the cases So in the real world application we should design the index base on the requirements of the business Understanding the distribution of the data would be very helpful and keep in mind that an index is designed only for a specific query 2022-11-23 09:10:27
ニュース BBC News - Home Tough asylum cases handled by new Home Office staff, say insiders https://www.bbc.co.uk/news/uk-63720698?at_medium=RSS&at_campaign=KARANGA newsnight 2022-11-23 09:34:26
ニュース BBC News - Home Matt Hancock broke rules with I'm A Celeb appearance, says watchdog https://www.bbc.co.uk/news/uk-politics-63727270?at_medium=RSS&at_campaign=KARANGA health 2022-11-23 09:20:36
IT 週刊アスキー スンドゥブ専門店の味を手軽に!「東京純豆腐」監修の「カップ麺」が登場 https://weekly.ascii.jp/elem/000/004/114/4114405/ 日清食品 2022-11-23 18:45:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)