TomTom
March 16, 2018, 2:37pm
1
What is the best mapping for a join between two documents?
Actually, i'm creating a data warehouse to stock my postgres data:
table: customer
column | type
---------------------------
id_customer | integer
name | varchar
email | varchar
enabled | char
table: order
column | type
---------------------------
id_order | integer
id_customer | integer (foreign key from customer)
value | numeric
finishied | char
How i create a mapping to this both documents?
Because i will need search in orders when the customer (father) has the property enabled equal to 'Y'.
dadoonet
(David Pilato)
March 16, 2018, 2:58pm
2
Or what about a document like:
PUT orders/doc/1
{
"value": 1,
"finishied": true,
"customer": {
"name": "Joe Smith",
"email": "joe@foo.bar",
"enabled": true
}
}
TomTom
March 16, 2018, 3:34pm
3
Hi @dadoonet .
After a customer update will be necessary reindex all the orders, and some customer can have a huge quantity of orders.
dadoonet
(David Pilato)
March 16, 2018, 3:47pm
4
After a customer update will be necessary reindex all the orders
Yes.
and some customer can have a huge quantity of orders.
How many? Like more than 1 million orders?
How long would that take?
I mean that for sure you have to pay a price at some point.
Do you want to pay the price at index time? Or at search time?
1 Like
TomTom
March 16, 2018, 4:05pm
5
Thanks @dadoonet , your observation make all sense.
Is best pay the price at index time, whereas the client change occurs less frequently than orders.
system
(system)
Closed
April 13, 2018, 4:18pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.