Primary and Foreign keys
Hi, I've been trying to understand if there is any performance benefit in using primary and foreign key constraints when performing join queries. I've tested joining a table with 1 million rows with one with 60k. Tryed the same queries with and without constraints and couldn't see a significant change in execution time. The tables are not that big but they are a sample of what we'll be working with in average. Should i be seeing any difference? Hows do PK and FK constraints affect query performance in Monetdb? Will it only be noticeable with larger datasets? Thank you Hilario Fernandes
Hi If you declare a FK constraint, MonetDB will create a join index immediately. For primary keys, a hash would mostly be chosen, which is fast to exploit in a join as well. regards, Martin On 10/22/13 7:07 PM, Hilario Fernandes wrote:
Hi,
I've been trying to understand if there is any performance benefit in using primary and foreign key constraints when performing join queries.
I've tested joining a table with 1 million rows with one with 60k. Tryed the same queries with and without constraints and couldn't see a significant change in execution time.
The tables are not that big but they are a sample of what we'll be working with in average.
Should i be seeing any difference? Hows do PK and FK constraints affect query performance in Monetdb? Will it only be noticeable with larger datasets?
Thank you
Hilario Fernandes
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Hilario Fernandes
-
Martin Kersten