This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const fs = require('fs') | |
const axios = require('axios') | |
const server = http.createServer((_, res) => { | |
axios.get('https://api.thecatapi.com/v1/images/search?breed_id=beng') | |
.then(data => console.log(data.data[0].breeds)) | |
res.end('Hello there') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const fs = require('fs') | |
const server = http.createServer((_, res) => { | |
console.log(fs.readFileSync('./package.json')); | |
res.end('Hello there') | |
}) | |
server.listen(5000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const fs = require('fs') | |
const server = http.createServer((_, res) => { | |
fs.readFile('./package.json', console.log) | |
res.end('Hello there') | |
}) | |
server.listen(5000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const server = http.createServer((_, res) => res.end('Hello there')); | |
server.listen(5000); | |
console.log('Server running'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OS = require('os') | |
process.env.UV_THREADPOOL_SIZE = OS.cpus().length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexing=# explain analyze select name from students where name = 'Victor'; | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------- | |
Seq Scan on students (cost=0.00..1.30 rows=1 width=32) (actual time=0.010..0.011 rows=2 loops=1) | |
Filter: (name = 'Victor'::text) | |
Rows Removed by Filter: 22 | |
Planning Time: 0.040 ms | |
Execution Time: 0.019 ms | |
(5 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexing=# create index student_name on students(name); | |
CREATE INDEX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexing=# explain analyze select name from students where name = 'Victor'; | |
QUERY PLAN | |
---------------------------------------------------------------------------------------------------- | |
Seq Scan on students (cost=0.00..20.12 rows=4 width=32) (actual time=1.677..1.715 rows=2 loops=1) | |
Filter: (name = 'Victor'::text) | |
Rows Removed by Filter: 22 | |
Planning Time: 15.170 ms | |
Execution Time: 10.083 ms | |
(5 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexing=# explain analyze select name from students where id = 20; | |
QUERY PLAN | |
---------------------------------------------------------------------------------------------------- | |
Seq Scan on students (cost=0.00..20.12 rows=4 width=32) (actual time=0.068..0.070 rows=1 loops=1) | |
Filter: (id = 20) | |
Rows Removed by Filter: 23 | |
Planning Time: 0.209 ms | |
Execution Time: 0.151 ms | |
(5 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indexing=# explain analyze select id from students where id = 20; | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------- | |
Seq Scan on students (cost=0.00..20.12 rows=4 width=8) (actual time=0.009..0.010 rows=1 loops=1) | |
Filter: (id = 20) | |
Rows Removed by Filter: 23 | |
Planning Time: 0.033 ms | |
Execution Time: 0.020 ms | |
(5 rows) |