1
00:00:00,300 --> 00:00:06,270
In this video, we are going to learn query and scan operations on dynamic DB table.

2
00:00:07,090 --> 00:00:13,080
You remember that when we are working with the management console, we have to option scan and query.

3
00:00:13,110 --> 00:00:16,410
When we click the query, we have to provide the primary key.

4
00:00:16,410 --> 00:00:20,820
In this table there is only one primary key, which is the partition key is ID.

5
00:00:21,710 --> 00:00:27,260
So if you look at the documentation, there is a Dynamo DB API reference documentation.

6
00:00:27,260 --> 00:00:35,120
You can see that query and second operation is a Dynamo DB API that we can call from the any resources

7
00:00:35,120 --> 00:00:38,060
like a SLI management console or SDK.

8
00:00:38,090 --> 00:00:43,550
So in these videos we will query and scan operation from the HTK libraries.

9
00:00:43,850 --> 00:00:45,110
So what is the query?

10
00:00:45,140 --> 00:00:51,170
Query is basically points item in the table with looking the primary key attributes.

11
00:00:51,170 --> 00:00:54,890
So if the primary key has only part sync, it is required part sync.

12
00:00:54,920 --> 00:01:02,480
If it is two items with partition and sort k, it is requiring both two items with partition and the

13
00:01:02,480 --> 00:01:02,720
sort.

14
00:01:02,720 --> 00:01:08,420
K So we have to provide a partition, key name and volume for which search will be performed.

15
00:01:08,450 --> 00:01:15,470
And we can also provide a third key name and value and use the comparison operators to define results

16
00:01:15,470 --> 00:01:16,430
of the search.

17
00:01:16,790 --> 00:01:21,230
So scanning finds the items by checking every item in the specified table.

18
00:01:21,230 --> 00:01:24,080
So there is a big difference with the query and scan.

19
00:01:24,080 --> 00:01:27,950
If you click the scan operation, you can see that.

20
00:01:27,950 --> 00:01:31,070
Before that I would like to show the query operation.

21
00:01:31,070 --> 00:01:36,590
If you scroll down, you can see the request syntax that we can provide these attributes.

22
00:01:36,590 --> 00:01:38,720
One Running to query operation.

23
00:01:38,720 --> 00:01:44,390
By using the SSC, we will provide this kind of input, these kind of attributes.

24
00:01:44,390 --> 00:01:48,860
So, for example, key conditions, fit exhibitions and so on.

25
00:01:48,860 --> 00:01:53,720
So if we go to scan operations and compare, this can be to create operations.

26
00:01:53,720 --> 00:01:59,990
Basically this scan operation returns one or more items and item attributes by accessing every item

27
00:01:59,990 --> 00:02:00,830
in the table.

28
00:02:01,040 --> 00:02:09,020
And this is very important because scan operation is very costly service that we cannot use, that we

29
00:02:09,020 --> 00:02:10,940
should not use every operation.

30
00:02:11,060 --> 00:02:17,690
And if we use the scan operation, it is basically scanning all items in the table and return back to

31
00:02:17,690 --> 00:02:19,250
us, the whole results.

32
00:02:19,370 --> 00:02:21,620
So as you can see that this is the scan operation.

33
00:02:21,620 --> 00:02:25,550
If you scroll on, you can see the request syntax of the scan operation.

34
00:02:25,550 --> 00:02:30,890
We can use these attribute values when sending this scan dynamic DB API.

35
00:02:31,010 --> 00:02:36,740
So in the next video we will send query and scan command from our Node.js application.

36
00:02:36,740 --> 00:02:38,240
We use the SDK libraries.
