自动加固与统一私法之间的真正区别是什么?
我认为,汽车机车很容易降落。
在许多记录中,设计比自动加固要慢,但是在这项工作中却存在巨大差异?
自动加固与统一私法之间的真正区别是什么?
我认为,汽车机车很容易降落。
在许多记录中,设计比自动加固要慢,但是在这项工作中却存在巨大差异?
从关系模式的角度来看,“主要关键
PK越小越好。 因此,<>数字 PK是最好的。
如果你担心“hack”很容易,你可以补充UIDD,作为天然钥匙。
这就是我在几个项目中所看到的,它像魔法一样起作用。
一个递增的ID本身并不“容易被黑客攻击”,它只是提供了入口点,当您使用一个大的随机ID时,这些入口点被隐藏起来(但并非完全隐藏)。仍然需要有糟糕的实现和可利用的软件才会有真正的危险。正如您在地址栏中看到的URL,这个网站使用递增的ID没有任何问题。
除了安全方面的考虑之外,当您不希望用户轻易猜测其他(虽然是公开的)内容的URL时,随机的唯一ID有时会很有帮助。例如,在房地产网站上,即使他们可以通过搜索找到所有竞争对手的条目,您也可能不希望提供“向上和向下”查看ID的可能性。有点阻碍可能是一件好事。
为什么不两个都用呢?一个数字自增键用于索引和关系的速度;一个随机UID用于外部访问。
一些想法:
Take care of the LENGTH of your PK column... UUIDs and GUIDs are extremely long... strings. An INT or even BIGINT autoincement column can ensure uniqueness in a much smaller space.
BEWARE that autoincement columns have a few issues of their own around table management. If you truncate/drop-create tables then an auto-increment will be hard to maintain. ALSO, only 1 auto-increment column in MySQL is allowed for a single table.
如果您的数据允许,使用从数据派生的某种哈希来进行索引和性能优化。
I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
我把我的用心从使用QQL转向MySQL。 它与凯科特合作,现在不工作,因为我已经改变,使用MySQL。 这里的错误信息是:
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...
Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...
What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...
My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...